Updating Forecolor on TabPage Programmatically

0
0

This code snippet below from a VWG Conversion updates the Tab Page’s Forecolor to Red
In Wise J it does not work.
Is there some method to force programmatic change of forecolor to the Tab Page’s text
to refresh in the UI? It initializes as black.

pgNotes.ForeColor = System.Drawing.Color.Red;
pgNotes.Font = new System.Drawing.Font(pgNotes.Font, System.Drawing.FontStyle.Bold);
//tabControl1.Refresh();
//pgNotes.Refresh();
tabControl1.Recreate();

My attempts to Call Refresh or Recreate at tab control or tab page level do not seem to have any effect.

  • You must to post comments
0
0

Hi Christian,

I don’t see any issues in setting the Forecolor directly.
Please find attached sample where the Forecolor of Page1 was set with the designer and the Forecolor of Page2 is set when you click the button.
If that does not work for you please send us a compilable test application and we’ll investigate.

Best regards
Frank

  • You must to post comments
0
0

We are not VWG and we have nothing to do with that framework. In our theming system the selectable part of the TabPage is called “button”.

It’s unclear if you are trying to set the color of the button part or the TabPage or the content of the panel related to the Tab. Without a runnable test case we can’t help you with your issue amy further. Please refer to the posting guidelines.

 

 

  • Christian Programmer
    You are WiseJ and I am attempting to change the TEXT portion of a tabpage as it is affected by pgNotes.ForeColor as indicated in the code sample pgNotes.ForeColor = System.Drawing.Color.Red; The WiseJ userinterface in its designer responds to changes when setting the property Forecolor. I will make a sample of an attempt to change the forecoloir if that helps.
  • You must to post comments
0
0

Hi Christian,

what color do you want to change on the Tab Page? In any case the best way would be to modify your theme or add a theme mixin.
If you want to change the color of the header of the tab page you would have to adjust

TabView - Page - Button - Default - Properties - TextColor

if you want to change the color in the tab page content area it’s

TabView - Page - Default - Properties - TextColor

You can either change it globally in theme/mixin or globally in code or work with different appearance keys if you want to have different TabPage views.

Best regards
Frank

  • Christian Programmer
    The code is pretty straight forward it is the Foreground TEXT that appears on the Tab page itself as I have shown pgNotes.ForeColor = System.Drawing.Color.Red; why are you referencing buttons and stuff? I do not follow . It i s just the text on the tab itself . Am I supposed to somehow PROGRAMATICALLY Set the TEXT RED for the condition indicating that this tab page has active notes by PROGRAMATICALLY affecting some theme or as you say mixIn ? Is there a link or sample for how this is implemented ?
  • Christian Programmer
    Thank you s Frank ! The sample pointed me to the correct property of the tab page of the Tab control itself ! Thank you! “pgNotes.TabForeColor = System.Drawing.Color.Red;”
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.