473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 1818
'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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.