472,364 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

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.EventArgs) 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 1713
'first select the right tabpage on the tabcontrol
tabcontrol.SelectedTab = tabPageYouWant
'setfocus to control on tabPageYouWant
contol.setfocus

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.EventArgs) 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********@ThiSbitconsult.be.RE> wrote:
'first select the right tabpage on the tabcontrol
tabcontrol.SelectedTab = tabPageYouWant
'setfocus to control on tabPageYouWant
contol.setfocus

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.EventArgs) 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********@ThiSbitconsult.be.RE> scripsit:
'first select the right tabpage on the tabcontrol
tabcontrol.SelectedTab = 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**********@planet.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**********@planet.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********@ThiSbitconsult.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
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...
2
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...
9
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...
5
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...
2
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 -...
12
by: Michael R | last post by:
TabCtrl --- ..............Tab1--Subform1 ..............Tab2--Subform2---TabCtrl2---Tab21 ..........................................................---Tab22...
3
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
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...
0
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...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.