|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Set Focus to textbox on tab controlVS 2005
On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes on it. When I click on each tab, I would like to have the focus set to the first textbox. On the tabenter event for each tab, I put a textbox1.focus but the textbox doesn't contain the cursor. How can I do this? Try putting it in the click event of the tabcontrol. Just verify the
index of the selected tab, then focus on the appropriate textbox. Tom Henry Jones wrote: Show quoteHide quote >VS 2005 > >On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes on >it. When I click on each tab, I would like to have the focus set to the >first textbox. > >On the tabenter event for each tab, I put a textbox1.focus but the textbox >doesn't contain the cursor. > >How can I do this? > > > > > I wanted the textbox to have the focus when the tab appears in front. I
have already clicked on the tab label at the top and when I put the focus in the click event on the tab, your suggestion works, but I might as well have clicked in the textbox! I would like to have focus on the textbox when the tab appears. Any suggestions? Thanks H Show quoteHide quote "tomb" <t***@technetcenter.com> wrote in message news:3RyVg.48741$vX5.19328@bignews8.bellsouth.net... > Try putting it in the click event of the tabcontrol. Just verify the > index of the selected tab, then focus on the appropriate textbox. > > Tom > > Henry Jones wrote: > >>VS 2005 >> >>On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes >>on it. When I click on each tab, I would like to have the focus set to >>the first textbox. >> >>On the tabenter event for each tab, I put a textbox1.focus but the textbox >>doesn't contain the cursor. >> >>How can I do this? >> >> >> >> On Fri, 6 Oct 2006 15:07:07 -0700, "Henry Jones" <he***@yada.com> wrote: You would need to get the child index of the first textbox on each page before you>I wanted the textbox to have the focus when the tab appears in front. I >have already clicked on the tab label at the top and when I put the focus in >the click event on the tab, your suggestion works, but I might as well have >clicked in the textbox! > >I would like to have focus on the textbox when the tab appears. Any >suggestions? > >Thanks > >H can set it's focus: With Me.TabControl1.SelectedTab .Controls(.Controls.GetChildIndex(Me.SomeTextBox)).Focus() End With In the TabControl SelectedIndexChanged event, identify the selected tab and then setup a Select Case statement for the 5 tabs to specify which patricular textbox reference goes into the above code. Gene Show quoteHide quote > > >"tomb" <t***@technetcenter.com> wrote in message >news:3RyVg.48741$vX5.19328@bignews8.bellsouth.net... >> Try putting it in the click event of the tabcontrol. Just verify the >> index of the selected tab, then focus on the appropriate textbox. >> >> Tom >> >> Henry Jones wrote: >> >>>VS 2005 >>> >>>On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes >>>on it. When I click on each tab, I would like to have the focus set to >>>the first textbox. >>> >>>On the tabenter event for each tab, I put a textbox1.focus but the textbox >>>doesn't contain the cursor. >>> >>>How can I do this? >>> >>> >>> >>> >
vb 6.0 naar vb.net 2005
Dynamic mapping string to function need help on optional arg Overlapping controls creating pictureboxes on the fly How to determen the object ? WEB combobox won't fire event Redrawing on GDI+ NullReferenceException with shared members Referencing parameters collection member by Name bombs? |
|||||||||||||||||||||||