Show Groupbox when button is clicked or Bring GroupBox to front?WinForm UI components layer orderFading in and fading out for a formButton OnClick not firing on first click in ASP.NET?how to show another form after playing swf file in c#How to disable Events?How to move gridview selected row up/down on KeyUp or Keydown pressHow to insert multiple check-box values to a same column of a SQL Database using C#? This should be done by a button clickhow to get .bak extension while creating backup in 3 tier projectRead and display in richtext the next line in a text document by clicking a button using C#c# database connection.Open() errorHide and restore the GUI Mutiple forms in c#

How do I reattach a shelf to the wall when it ripped out of the wall?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

My bank got bought out, am I now going to have to start filing tax returns in a different state?

What is the term for a person whose job is to place products on shelves in stores?

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

Retract an already submitted recommendation letter (written for an undergrad student)

Multiple fireplaces in an apartment building?

std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?

Contradiction proof for inequality of P and NP?

Is there really no use for MD5 anymore?

How to have a sharp product image?

How much cash can I safely carry into the USA and avoid civil forfeiture?

Drawing a german abacus as in the books of Adam Ries

A Paper Record is What I Hamper

Nails holding drywall

SFDX - Create Objects with Custom Properties

How to be good at coming up with counter example in Topology

A faster way to compute the largest prime factor

Apply a different color ramp to subset of categorized symbols in QGIS?

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

A ​Note ​on ​N!

Is there any pythonic way to find average of specific tuple elements in array?

Will I lose my paid in full property

Cayley's Matrix Notation



Show Groupbox when button is clicked or Bring GroupBox to front?


WinForm UI components layer orderFading in and fading out for a formButton OnClick not firing on first click in ASP.NET?how to show another form after playing swf file in c#How to disable Events?How to move gridview selected row up/down on KeyUp or Keydown pressHow to insert multiple check-box values to a same column of a SQL Database using C#? This should be done by a button clickhow to get .bak extension while creating backup in 3 tier projectRead and display in richtext the next line in a text document by clicking a button using C#c# database connection.Open() errorHide and restore the GUI Mutiple forms in c#






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have 3 GroupBox's that contain various TextBox's and Buttons, I have placed the 3 GroupBox's on top of each other and created 4 buttons so that when one of the buttons is clicked the GroupBox it refers to is shown above the other. To do this I tried .Visible and .BringToFront command. But It didn't work.



private void bunifuFlatButton1_Click(object sender, EventArgs e)

LOGINGROUP.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton2_Click(object sender, EventArgs e)


LOGINGROUP1.Visible = true;
LOGINGROUP.Visible=false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton3_Click(object sender, EventArgs e)


LOGINGROUP2.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP.Visible = false;











share|improve this question



















  • 1





    Possible duplicate of WinForm UI components layer order

    – Lankymart
    Mar 9 at 7:48






  • 1





    Can you check if you accidentally put the group boxes in one another ?

    – emumcu
    Mar 9 at 8:01











  • You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

    – Steve
    Mar 9 at 8:04











  • I checked it's not and sorry there is just 3 group boxes at the same location.

    – Asaf Duba
    Mar 9 at 8:43











  • Have you tried using .BringToFront?

    – preciousbetine
    Mar 9 at 8:58

















0















I have 3 GroupBox's that contain various TextBox's and Buttons, I have placed the 3 GroupBox's on top of each other and created 4 buttons so that when one of the buttons is clicked the GroupBox it refers to is shown above the other. To do this I tried .Visible and .BringToFront command. But It didn't work.



private void bunifuFlatButton1_Click(object sender, EventArgs e)

LOGINGROUP.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton2_Click(object sender, EventArgs e)


LOGINGROUP1.Visible = true;
LOGINGROUP.Visible=false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton3_Click(object sender, EventArgs e)


LOGINGROUP2.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP.Visible = false;











share|improve this question



















  • 1





    Possible duplicate of WinForm UI components layer order

    – Lankymart
    Mar 9 at 7:48






  • 1





    Can you check if you accidentally put the group boxes in one another ?

    – emumcu
    Mar 9 at 8:01











  • You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

    – Steve
    Mar 9 at 8:04











  • I checked it's not and sorry there is just 3 group boxes at the same location.

    – Asaf Duba
    Mar 9 at 8:43











  • Have you tried using .BringToFront?

    – preciousbetine
    Mar 9 at 8:58













0












0








0








I have 3 GroupBox's that contain various TextBox's and Buttons, I have placed the 3 GroupBox's on top of each other and created 4 buttons so that when one of the buttons is clicked the GroupBox it refers to is shown above the other. To do this I tried .Visible and .BringToFront command. But It didn't work.



private void bunifuFlatButton1_Click(object sender, EventArgs e)

LOGINGROUP.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton2_Click(object sender, EventArgs e)


LOGINGROUP1.Visible = true;
LOGINGROUP.Visible=false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton3_Click(object sender, EventArgs e)


LOGINGROUP2.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP.Visible = false;











share|improve this question
















I have 3 GroupBox's that contain various TextBox's and Buttons, I have placed the 3 GroupBox's on top of each other and created 4 buttons so that when one of the buttons is clicked the GroupBox it refers to is shown above the other. To do this I tried .Visible and .BringToFront command. But It didn't work.



private void bunifuFlatButton1_Click(object sender, EventArgs e)

LOGINGROUP.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton2_Click(object sender, EventArgs e)


LOGINGROUP1.Visible = true;
LOGINGROUP.Visible=false;
LOGINGROUP2.Visible = false;


private void bunifuFlatButton3_Click(object sender, EventArgs e)


LOGINGROUP2.Visible = true;
LOGINGROUP1.Visible = false;
LOGINGROUP.Visible = false;








c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 8:38







Asaf Duba

















asked Mar 9 at 7:40









Asaf DubaAsaf Duba

33




33







  • 1





    Possible duplicate of WinForm UI components layer order

    – Lankymart
    Mar 9 at 7:48






  • 1





    Can you check if you accidentally put the group boxes in one another ?

    – emumcu
    Mar 9 at 8:01











  • You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

    – Steve
    Mar 9 at 8:04











  • I checked it's not and sorry there is just 3 group boxes at the same location.

    – Asaf Duba
    Mar 9 at 8:43











  • Have you tried using .BringToFront?

    – preciousbetine
    Mar 9 at 8:58












  • 1





    Possible duplicate of WinForm UI components layer order

    – Lankymart
    Mar 9 at 7:48






  • 1





    Can you check if you accidentally put the group boxes in one another ?

    – emumcu
    Mar 9 at 8:01











  • You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

    – Steve
    Mar 9 at 8:04











  • I checked it's not and sorry there is just 3 group boxes at the same location.

    – Asaf Duba
    Mar 9 at 8:43











  • Have you tried using .BringToFront?

    – preciousbetine
    Mar 9 at 8:58







1




1





Possible duplicate of WinForm UI components layer order

– Lankymart
Mar 9 at 7:48





Possible duplicate of WinForm UI components layer order

– Lankymart
Mar 9 at 7:48




1




1





Can you check if you accidentally put the group boxes in one another ?

– emumcu
Mar 9 at 8:01





Can you check if you accidentally put the group boxes in one another ?

– emumcu
Mar 9 at 8:01













You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

– Steve
Mar 9 at 8:04





You talk about 4 groupboxes but you hide/show only three. Were is the fourth? Also check if you have nested them.

– Steve
Mar 9 at 8:04













I checked it's not and sorry there is just 3 group boxes at the same location.

– Asaf Duba
Mar 9 at 8:43





I checked it's not and sorry there is just 3 group boxes at the same location.

– Asaf Duba
Mar 9 at 8:43













Have you tried using .BringToFront?

– preciousbetine
Mar 9 at 8:58





Have you tried using .BringToFront?

– preciousbetine
Mar 9 at 8:58












1 Answer
1






active

oldest

votes


















0














Is there a reason why you can't use the TabControl Control?



From my understanding of your description, the button is also placed inside the groupbox. if they are all on top of each other, then you can only click on the button of the top groupbox.



If the above is not the case



This problem is most likely caused by the behaviour of groupboxes in Visual Studio's designer. When a groupbox is placed on top of another in the designer, the top box is automatically placed inside the bottom box, this can be seen in the following code produced by the designer:



 // 
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 227);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";


The highlight is this part:



this.groupBox1.Controls.Add(this.groupBox2);


as you can see, groupBox2 is placed as a control of groupBox1, this causes problems in sending to front since the only control in group is itself and the textboxes that are being overlapped by it.



to fix this, you can simply change



this.groupBoxX.Controls.Add(this.groupBoxY);


to



this.Controls.Add(this.groupBoxY);


or otherwise, simply declare the groupboxes yourself instead of relying on the designer. (however, this requires declaring the textboxes and handlers manually as well)






share|improve this answer























  • No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

    – Asaf Duba
    Mar 9 at 8:40











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075130%2fshow-groupbox-when-button-is-clicked-or-bring-groupbox-to-front%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Is there a reason why you can't use the TabControl Control?



From my understanding of your description, the button is also placed inside the groupbox. if they are all on top of each other, then you can only click on the button of the top groupbox.



If the above is not the case



This problem is most likely caused by the behaviour of groupboxes in Visual Studio's designer. When a groupbox is placed on top of another in the designer, the top box is automatically placed inside the bottom box, this can be seen in the following code produced by the designer:



 // 
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 227);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";


The highlight is this part:



this.groupBox1.Controls.Add(this.groupBox2);


as you can see, groupBox2 is placed as a control of groupBox1, this causes problems in sending to front since the only control in group is itself and the textboxes that are being overlapped by it.



to fix this, you can simply change



this.groupBoxX.Controls.Add(this.groupBoxY);


to



this.Controls.Add(this.groupBoxY);


or otherwise, simply declare the groupboxes yourself instead of relying on the designer. (however, this requires declaring the textboxes and handlers manually as well)






share|improve this answer























  • No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

    – Asaf Duba
    Mar 9 at 8:40















0














Is there a reason why you can't use the TabControl Control?



From my understanding of your description, the button is also placed inside the groupbox. if they are all on top of each other, then you can only click on the button of the top groupbox.



If the above is not the case



This problem is most likely caused by the behaviour of groupboxes in Visual Studio's designer. When a groupbox is placed on top of another in the designer, the top box is automatically placed inside the bottom box, this can be seen in the following code produced by the designer:



 // 
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 227);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";


The highlight is this part:



this.groupBox1.Controls.Add(this.groupBox2);


as you can see, groupBox2 is placed as a control of groupBox1, this causes problems in sending to front since the only control in group is itself and the textboxes that are being overlapped by it.



to fix this, you can simply change



this.groupBoxX.Controls.Add(this.groupBoxY);


to



this.Controls.Add(this.groupBoxY);


or otherwise, simply declare the groupboxes yourself instead of relying on the designer. (however, this requires declaring the textboxes and handlers manually as well)






share|improve this answer























  • No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

    – Asaf Duba
    Mar 9 at 8:40













0












0








0







Is there a reason why you can't use the TabControl Control?



From my understanding of your description, the button is also placed inside the groupbox. if they are all on top of each other, then you can only click on the button of the top groupbox.



If the above is not the case



This problem is most likely caused by the behaviour of groupboxes in Visual Studio's designer. When a groupbox is placed on top of another in the designer, the top box is automatically placed inside the bottom box, this can be seen in the following code produced by the designer:



 // 
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 227);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";


The highlight is this part:



this.groupBox1.Controls.Add(this.groupBox2);


as you can see, groupBox2 is placed as a control of groupBox1, this causes problems in sending to front since the only control in group is itself and the textboxes that are being overlapped by it.



to fix this, you can simply change



this.groupBoxX.Controls.Add(this.groupBoxY);


to



this.Controls.Add(this.groupBoxY);


or otherwise, simply declare the groupboxes yourself instead of relying on the designer. (however, this requires declaring the textboxes and handlers manually as well)






share|improve this answer













Is there a reason why you can't use the TabControl Control?



From my understanding of your description, the button is also placed inside the groupbox. if they are all on top of each other, then you can only click on the button of the top groupbox.



If the above is not the case



This problem is most likely caused by the behaviour of groupboxes in Visual Studio's designer. When a groupbox is placed on top of another in the designer, the top box is automatically placed inside the bottom box, this can be seen in the following code produced by the designer:



 // 
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 227);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";


The highlight is this part:



this.groupBox1.Controls.Add(this.groupBox2);


as you can see, groupBox2 is placed as a control of groupBox1, this causes problems in sending to front since the only control in group is itself and the textboxes that are being overlapped by it.



to fix this, you can simply change



this.groupBoxX.Controls.Add(this.groupBoxY);


to



this.Controls.Add(this.groupBoxY);


or otherwise, simply declare the groupboxes yourself instead of relying on the designer. (however, this requires declaring the textboxes and handlers manually as well)







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 9 at 8:15









RicksonRickson

212




212












  • No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

    – Asaf Duba
    Mar 9 at 8:40

















  • No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

    – Asaf Duba
    Mar 9 at 8:40
















No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

– Asaf Duba
Mar 9 at 8:40





No there is buttons inside the group boxes and also there is a menu with buttons. When I click to a button from menu I want to change the group box

– Asaf Duba
Mar 9 at 8:40



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075130%2fshow-groupbox-when-button-is-clicked-or-bring-groupbox-to-front%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved