|
-
Jul 15th, 2009, 07:45 AM
#1
Thread Starter
Fanatic Member
Displaying the Red error icons next to the headers of tabpages within tabControl
Hi,
- VS2008,Windows forms
You know those little error red icons displayed next to controls that are not valid, those controls are usually textbox, combobox..etc.
What I need is to display that same kind of error red icon next to tabpages headers in a tabcontrol.
I mean, whenever i do some sort of validation logic in one of the tabPages, if my logic returns false, then I want to be able to display the error red icon next to the header of that Tabpage that's not valid.
P.S: The value of that to the user is that once he is not in the same tabpage that is invalid, to spot quickly which tabpages have errors within them, by seing the error icon in the tabpage header.
Last edited by tutus; Jul 15th, 2009 at 07:46 AM.
Reason: edit
Thanks a lot for your help.
-
Jul 15th, 2009, 08:33 AM
#2
Re: Displaying the Red error icons next to the headers of tabpages within tabControl
Hi,
This could be very usefull.
-
Jul 15th, 2009, 09:09 AM
#3
Re: Displaying the Red error icons next to the headers of tabpages within tabControl
The normal way of doing this is (for the likes of textboxes) to add an errorprovider component for the form, however as far as I can see if you add this to a tabpage, the error icon appears to the right of the tab and gets chopped off by the tabcontrol itself.
This means that your best bet is to simply add an imagelist component to you form and add a warning icon to it, and then set the tabcontrol's imagelist property to reference this imageview.
Then when you want to flag a warning on a particular tabpage then you simply set the imageindex or imagekey property of the tabpage to reference the warning icon (if you only have the warning icon then simply set the tabcontrol's imageindex property to 0)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|