Results 1 to 3 of 3

Thread: Displaying the Red error icons next to the headers of tabpages within tabControl

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    589

    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.

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Displaying the Red error icons next to the headers of tabpages within tabControl

    Hi,

    This could be very usefull.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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
  •  



Click Here to Expand Forum to Full Width