1

So I am making a new project and I am using a theme for the first time (MetroSet). I currently have 30 buttons in a MetroSetTabControl tab all set to Visible=false. When I first launch the application, all is good. If I tab over to the 2nd tab, then go back to the first, all buttons are now shown.

Any ideas why its doing this, or how to resolve?

See GIF below

GIF added to show what I am talking about

Theme Set Being used: https://github.com/N-a-r-w-i-n/MetroSet-UI

Steps to replicate:

  1. Create a new Windows Forms Application project in Visual Studio and install MetroSet_UI via nuget:

    Install-Package MetroSet_UI
    
  2. Create a MetroSetForm and insert a MetroSetTabControl with 2 tabs

  3. Add 1 or more MetroSetButton to index 0 and set them all to Visible=false.
  4. Debug application starting on index 0
  5. Toggle to index 1 and back to 0
dbc
  • 104,963
  • 20
  • 228
  • 340
dwb
  • 475
  • 6
  • 31
  • Is it possible these buttons are being instantiated again when you change the tabs? – andresantacruz Aug 28 '19 at 22:10
  • @dedecos thats what I am assuming is happening, but I have no idea why, or how – dwb Aug 28 '19 at 22:19
  • Without further information it will be hard to help you. – andresantacruz Aug 28 '19 at 22:20
  • You could try to set a data breakpoint on write of one of these buttons visible variable to get a possible code that is changing its value. – andresantacruz Aug 28 '19 at 22:21
  • @dedecos not sure what other information you require. I have no back-end code (other then the designer, that I have not touched by hand) – dwb Aug 28 '19 at 22:31
  • @dbc I think I added what you are looking for. I have no other code then the designer at the moment, and that was all done using the toolbox (nothing touched within the designer code itself) – dwb Aug 28 '19 at 22:50
  • 1
    I can't find many questions about your framework here. There are some questions about https://thielj.github.io/MetroFramework. For more see [Creating metro style winform in windows 7 using C#](https://stackoverflow.com/q/9939070). – dbc Aug 28 '19 at 23:46
  • 1
    Can you specify exactly what [controls](https://github.com/N-a-r-w-i-n/MetroSet-UI/tree/master/MetroSet%20UI/Controls) you are adding? E.g. is `TabControl` actually [`MetroSet_UI.Controls.MetroSetTabControl`](https://github.com/N-a-r-w-i-n/MetroSet-UI/blob/master/MetroSet%20UI/Controls/MetroSetTabControl.cs)? – dbc Aug 28 '19 at 23:53
  • @dbc Ya that looks correct. The controls I am using are MetroSetButton, MetroSetTabControl and MetroSetForm (for the form style itself). As a current work-around, I just added a function to check everytime it changes tabs, what is should be set to. At this point, I just want to know why its acting silly. – dwb Aug 29 '19 at 00:09

0 Answers0