tags:

views:

88

answers:

3

I have a form(C#) with a tab control and its has around five tab pages.

each of the tab have a few textboxes.

1) if a User is in say Tab A and edits certain fields i need to validate the text enetered if found invalid then i should not allow any tab switch ? is that possible?

2) Another case could be ... user edits some values and clicks on another tab, on doing so i need to check if the values that were enetered for Tab A is correct or not ? can i do this?

I am a novice to C#... so may be these questions sound very basic any help will be appreciated.

also i want to know what are these events of a tab page

Leave, validated or validating ?

A: 

u mean the change event ?

Maneesh
A: 

You could hook up to the TabIndexChanged on the TabControl and have a variable that says if they are allowed to change or not and just change back to the orginal tab if they are not allowed.

Petoj
Thanks will try so.
Maneesh
A: 

You can disable a tab page. Is not the best/simplest way but is working. Here is how to do it: http://social.msdn.microsoft.com/forums/en-US/winforms/thread/985b41c3-a1de-4744-8875-63262d4c2718/

Victor Hurdugaci