473,404 Members | 2,114 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,404 software developers and data experts.

How To force to stay in a tabpage

First, I thank you Herfried.

I have 3 tabpages in a tabcontrol.
I would like to force the user to stay in the current tabpage until he
doesn't correctly fill some textboxes.
I know how to prevent bad entries but if I click onto another tabpage, I can
leave the current tabpage.
I try to use the select property but it doesn't work.
Any idea ?

Stan
Nov 20 '05 #1
4 1617
Cor
Hi Stan,

I don't know if Herfried is the only one who should answer, but when not,

I think I would just make a routine that is like this in the
tabcontrol.click event.
(not really tested)
private tabpageready as integer = 99
\\\
if tabpageready = 99 then
tabpageready = tabcontrol.selectedindex
else
tabcontrol.selectedindex = tabpageready
end if

And then in every tabpage when it is ready set tapageready to 99.
///

Just a thought

Cor
"Stan Sainte-Rose" <st**@cyber972.com> schreef in bericht
news:uw**************@tk2msftngp13.phx.gbl...
First, I thank you Herfried.

I have 3 tabpages in a tabcontrol.
I would like to force the user to stay in the current tabpage until he
doesn't correctly fill some textboxes.
I know how to prevent bad entries but if I click onto another tabpage, I can leave the current tabpage.
I try to use the select property but it doesn't work.
Any idea ?

Stan

Nov 20 '05 #2
* "Stan Sainte-Rose" <st**@cyber972.com> scripsit:
First, I thank you Herfried.
Why?

;-)
I have 3 tabpages in a tabcontrol.
I would like to force the user to stay in the current tabpage until he
doesn't correctly fill some textboxes.
I know how to prevent bad entries but if I click onto another tabpage, I can
leave the current tabpage.
I try to use the select property but it doesn't work.


This code shows how to detect when the selected tab changes:

<http://www.google.de/groups?selm=hxAg9.261485%24kp.887854%40rwcrnsc52.o ps.asp.att.net>

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

I find my example a litte bit less complex

:-)

Cor

<http://www.google.de/groups?selm=hxA...wcrnsc52.ops.a
sp.att.net>
Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
I find my example a litte bit less complex


;-)

I find the p/invoke solution more, let's say, "elegant".

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

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

Similar topics

4
by: TMB333 | last post by:
I've researched as much as I can on the issue, but I've not found any clearly defined statement that acknowledges that the Hide method for a TabPage object just doesn't do what it's supposed to do....
9
by: Robb Gilmore | last post by:
Hello, This is probably an easy one, but I have not been able to figure it out so far. I have a tab control on a windows forms app. Depending on some business logic, I need to hide/show some...
2
by: JG | last post by:
Hi, I have a windows form with a TabControl on it. It has 3 tabpages on it. I have also coded a button that is supposed to 'add' a new tabpage. The code in that clicked event looks like this:...
1
by: RA | last post by:
Hi 1) I want to create a TabPage class in design mode - how do I do it? What type of project should I use? Is it going to be a custom control? 2) I have a TabControl that I would like to add to...
3
by: Cynthia | last post by:
I knew that "Hide" doesn't work with Tabpage if I want to hide it. I should use Remove/Add. But I have some other controls in the tabpage which I don't want to use code to dynamiclly create them....
8
by: touf | last post by:
Hi, I've a tabcontrol that contains many similar tabpages (exactly the same structure with different information), the tabpages number isn't known in the design time it depends of the data. Is...
4
by: Ratan | last post by:
I have a form that has a tabcontrol with 5 tabpages. i want to rename the tabpages in runtime. Actually i want to right click the tabpage i want to rename and edit the text there itself. How to...
6
by: ray well | last post by:
i want a user to be able to change tab pages thru the keyboard, i tried entering the TabPage.text as '&1 Names', "&2 Addresses', etc., so that the user can change pages by type ALT 1, ALT 2, on the...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello gurus, I want to have a Form with a TabControl, this TabControl will contain TabPage that has controls in it, this TabPage is prepared at design time. I want in runtime to duplicate the...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.