Attach components to GroupBox in C#
-
I want to insert a group box in the form and put in 3 radio buttons in it. Are there any advantages in attaching the 3 radio buttons to the groupbox.? Cab we even do that? If I have to do it how do i attach the 3 radio buttons to the groupbox so that they become part of the group box and not separate components on the form?
-
Answer:
If you are talking winforms; simply drag the radio button controls into the GroupBox in the forms designer. If you want to add them programmatically, something like this should work: RadioButton rb = new RadioButton(); rb.Text = "Some text"; myGroupBox.Controls.Add(rb); rb.Location = new Point(someX, someY); // repeat as necessary
zack at Stack Overflow Visit the source
Other answers
In code, assuming that you have a groupbox variable name groupBox1: groupBox1.Controls.Add(radioButton1); groupBox1.Controls.Add(radioButton2); groupBox1.Controls.Add(radioButton3); If you mean in terms of the designer, just drag the radiobuttons on to the groupbox rather than the form.
Kazar
Related Q & A:
- What Are The Components Of Health?Best solution by Yahoo! Answers
- How To Get All Components Based On A Schema And From A Particular Publication?Best solution by Tridion
- How to layer my graphic components?Best solution by Stack Overflow
- How to learn C# (moving from C++ to C#?Best solution by stackoverflow.com
- Why can't I attach file though I click the "attach file" button?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.