C++ Forms - Stacking trackbars causes weird visual effects and crash

95 views Asked by At

I am currently building a form in a DLL. It works very well at the moment. I basically have these 3 trackbars that set a colour for a certain function. Now it sort of works like this:

Player1 - R, G, B
Player2 - R, G, B

So I decided to use a drop down box to be able to select which colour you are actually changing. So if you choose player2, you get the player2 sliders and vice versa.

Here is an example:

enter image description here

You can see the sliders at the bottom. Now if we change to our team category. They should switch sliders which I have implemented like:

    if (dropdown_ESPColour->SelectedIndex == 0) {
        trackbar_TeamBlue->Visible = 0;
        trackbar_TeamGreen->Visible = 0;
        trackbar_TeamRed->Visible = 0;

        trackbar_EnemyBlue->Visible = 1;
        trackbar_EnemyGreen->Visible = 1;
        trackbar_EnemyRed->Visible = 1;
    }
    else if (dropdown_ESPColour->SelectedIndex == 1) {
        trackbar_EnemyBlue->Visible = 0;
        trackbar_EnemyGreen->Visible = 0;
        trackbar_EnemyRed->Visible = 0;

        trackbar_TeamBlue->Visible = 1;
        trackbar_TeamGreen->Visible = 1;
        trackbar_TeamRed->Visible = 1;
    }

But now when we change to team we get this weird visual bug:

enter image description here

You probably wont see but it has grey boxes where they are suppose to be. It doesnt show well if at all in the picture. Whenever I click on one of these boxes it crashes the form. Switching the sliders back to Enemy works fine however and gives me the sliders back.

0

There are 0 answers