473,572 Members | 3,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setfocus from tab2 to tab1 in tabcontrol.

i have a tabcontrol in my form and i have a datagrid in tab2 and want
to validate the data in tab1 before the user can encode data in
datagrid. i set the the datagrid1_enter event to something like this:

Private Sub DataGrid1_Enter (ByVal sender As Object, ByVal e As
System.EventArg s) Handles DataGrid1.Enter
If IDNo.Text = "" Then
MessageBox.Show ("Enter students idno information
before entering school year and semester.")

Me.IDNo.Focus()
End If
End Sub

in order that if the idno is empty which is located in tab1 the focus
will return to idno in tab1.

i used the code above w/ no luck. anyone can suggest a good way to
handle setfocus?

thanks in advance
Nov 20 '05 #1
7 1833
'first select the right tabpage on the tabcontrol
tabcontrol.Sele ctedTab = tabPageYouWant
'setfocus to control on tabPageYouWant
contol.setfocus

hope it helps

"jaYPee" <hi******@yahoo .com> wrote in message
news:qn******** *************** *********@4ax.c om...
i have a tabcontrol in my form and i have a datagrid in tab2 and want
to validate the data in tab1 before the user can encode data in
datagrid. i set the the datagrid1_enter event to something like this:

Private Sub DataGrid1_Enter (ByVal sender As Object, ByVal e As
System.EventArg s) Handles DataGrid1.Enter
If IDNo.Text = "" Then
MessageBox.Show ("Enter students idno information
before entering school year and semester.")

Me.IDNo.Focus()
End If
End Sub

in order that if the idno is empty which is located in tab1 the focus
will return to idno in tab1.

i used the code above w/ no luck. anyone can suggest a good way to
handle setfocus?

thanks in advance

Nov 20 '05 #2
thank you very much. it works fine.

On Tue, 27 Apr 2004 11:39:27 +0200, "EricJ"
<er********@Thi Sbitconsult.be. RE> wrote:
'first select the right tabpage on the tabcontrol
tabcontrol.Sel ectedTab = tabPageYouWant
'setfocus to control on tabPageYouWant
contol.setfocu s

hope it helps

"jaYPee" <hi******@yahoo .com> wrote in message
news:qn******* *************** **********@4ax. com...
i have a tabcontrol in my form and i have a datagrid in tab2 and want
to validate the data in tab1 before the user can encode data in
datagrid. i set the the datagrid1_enter event to something like this:

Private Sub DataGrid1_Enter (ByVal sender As Object, ByVal e As
System.EventArg s) Handles DataGrid1.Enter
If IDNo.Text = "" Then
MessageBox.Show ("Enter students idno information
before entering school year and semester.")

Me.IDNo.Focus()
End If
End Sub

in order that if the idno is empty which is located in tab1 the focus
will return to idno in tab1.

i used the code above w/ no luck. anyone can suggest a good way to
handle setfocus?

thanks in advance


Nov 20 '05 #3
* "EricJ" <er********@Thi Sbitconsult.be. RE> scripsit:
'first select the right tabpage on the tabcontrol
tabcontrol.Sele ctedTab = tabPageYouWant
'setfocus to control on tabPageYouWant
contol.setfocus


It's 'Focus', not 'SetFocus'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Hi Herfried,

You can type fast enough.
It's 'Focus', not 'SetFocus'.


Can also as:

Hi Eric,

Probably you know, however for when it is read back on Google.

It's 'Focus', not 'SetFocus'

Herfried

:-)

Cor
Nov 20 '05 #5
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
You can type fast enough.
It's 'Focus', not 'SetFocus'.


Can also as:

Hi Eric,

Probably you know, however for when it is read back on Google.

It's 'Focus', not 'SetFocus'


I am not "wordy", maybe because of my technical education :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
i dont mind (wouldnt expect it any other way from Herfried ;) ), and i know,
it slipped past. hadn't even noticed it.
jaYPee got it working and that's wat matters most.


"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:c6******** ****@ID-208219.news.uni-berlin.de...
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
You can type fast enough.
It's 'Focus', not 'SetFocus'.


Can also as:

Hi Eric,

Probably you know, however for when it is read back on Google.

It's 'Focus', not 'SetFocus'


I am not "wordy", maybe because of my technical education :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #7
* "EricJ" <er********@Thi Sbitconsult.be. RE> scripsit:
jaYPee got it working and that's wat matters most.


Full ACK.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
18488
by: Tamir Khason | last post by:
How be able to manage more deeply UI of TabControl and TabPage For example - I want to manage border color, change color of TabPage reef, eliminate spaces from both sides of the reef, so I bould custom control that inherit all information from TabPage, but how to access those properties, not supported by standart interface??? Thank you
2
2355
by: Patrick McGuire | last post by:
I want to place a tabControl with almost identical properties on several forms. I think the best way is to define a UserControl that inherits System.Windows.Forms.TabControl, and place all my controls on it. The problem is that I don't know how to bring up the graphical design interface for the TabControl. I suppose I COULD just design it...
9
3447
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so the are set to the right color, I can obviously change the tabpage colour but I am left with a grey top edge(Where there are no buttons) when the...
5
3328
by: Zadkin | last post by:
Does anyone know, if it's possible to set the orientation of the tabpagebuttons to horizontal instead of vertical when the alignment property of my tabcontrol is set to left or right? Thanks in advance Zadkin
2
3339
by: Simon Verona | last post by:
I have a few hundred forms in my application. All are based on a custom base form class. I decided that I wanted to globally change the look and feel of many of the controls in my application - including the tab control. I did this by writing a component that I attached to the form. The component has a "Start" function which takes the form...
12
2868
by: Michael R | last post by:
TabCtrl --- ..............Tab1--Subform1 ..............Tab2--Subform2---TabCtrl2---Tab21 ..........................................................---Tab22 ..........................................................---Tab23 ..............Tab3--Subofrm3 I need to setfocus on Tab22 I've tryed - me.Tab2.Tab22.setfocus and...
3
1465
by: potti | last post by:
I tried to transfer data from 2columns in TABLE1 to TABLE2: INSERT INTO TAB2(col1,col2) SELECT colY,colZ FROM TAB1. It didn't work. Pl suggest a way for this.
1
3439
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all In a Visual Studio 2005 C# project, I have a simplest tabcontrol with two tabpages. When I set tab control's Alignment property to Right, tab texts (captions) disappear. Does anybody know how to fix this? I tried this on two computers, at work and at home, both with Windows XP with latest service packs, and Framework 2.0 and 3.0...
0
1407
by: bertie78 | last post by:
Hi all, New poster here! I'm having some difficulty updating a tabcontrol cross-threads. The general idea is : the main thread is the owner of the tab control and the form controls. However, due to the vast amount of data to populate listviews within the tabs, I have created a worker thread (an implementation of a BackgroundWorker) to form the...
0
7640
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7957
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7705
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1240
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.