473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

GroupBox not showing Controls (sometimes)

Sometimes Controls that have been added to a GroupBox do not show up.

What I am doing :
1) I am not using the designer, but create all the Controls per hand:
groupBoxProdukt_01 = new System.Windows.Forms.GroupBox();
etc. for all other Controls.
After setting Font and Text values I then add them to the Panel:
pnPanelControls.Controls.Add(groupBoxProdukt_01);
pnPanelControls.Controls.Add(groupBoxProdukt_02);
pnPanelControls.Controls.Add(groupBoxProdukt_03);
pnPanelControls.Controls.Add(groupBoxProdukt_04);
pnPanelControls.Controls.Add(groupBoxProdukt_05);

groupBoxProdukt_01.Controls.Add(comboBoxProdukt_Ar t);
groupBoxProdukt_01.Controls.Add(textBoxProdukt_Nam e);
groupBoxProdukt_01.Controls.Add(textBoxProdukt_Tex t);
groupBoxProdukt_02.Controls.Add(comboBoxProdukt_Li eferant);
groupBoxProdukt_02.Controls.Add(labelProdukt_Preis );
groupBoxProdukt_02.Controls.Add(textBoxProdukt_Pre is);
groupBoxProdukt_02.Controls.Add(labelProdukt_Unit) ;
groupBoxProdukt_03.Controls.Add(textBoxProdukt_Ver packung);
groupBoxProdukt_03.Controls.Add(comboBoxProdukt_Ve rpackung);
groupBoxProdukt_04.Controls.Add(textBoxProdukt_Hal tbarkeit);
groupBoxProdukt_04.Controls.Add(comboBoxProdukt_Ha ltbarkeit);
groupBoxProdukt_05.Controls.Add(labelProdukt_SollM enge);
groupBoxProdukt_05.Controls.Add(textBoxProdukt_Sol lMenge);
pnPanelControls.Controls.Add(button_Produkt_Shoppi ng);
etc for Controls of other Dialogs.

Attribute Visiable is set to false for all Controls.
An OnSize Method sets size and Location at run time. and the Controls that
should be shown are set to Visiable= true;

There are four different types of Dialogs, one of which, will be shown. The
above shown "Produkt" is one
with 5 GroupBoxes. The other Dialogs have one GroupeBox and show fine,
Produkt shows only the first
GroupBox with the desigered Controls. The other GroupBoxes are shown but are
empty. The Buttons outside the GroupBoxes also show.

When I first tried this I placed all Controls on to the Panel and the
Controls show up. But if I called another Dialog before "Produkt" and then
called Produkt then ALL the GroupBoxes where empty.
When setting the GroupBox to visiable=false, the Controls showed in the
proper position.
I found out that the Controls should be added to the GroupBox hoping this
would solve the problem.
But it works only with the first GroupBox and not the others that are set to
visable.

Mark Johnson, Berlin Germany
mj*****@mj10777.de
Nov 16 '05 #1
0 2252

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Renee | last post by:
Hi there, does any one know how to create context sensitive help for Groupbox control with HelpProvider class? I can create context sensitive help for any control easily except for Groupbox. ...
0
by: dantheman | last post by:
Hi, i'm doing a programe in a few languages so i've found this code that iterates tru the forms controls and returns there names but the problem is after re-parenting the controls to optimize...
2
by: Dan Neely | last post by:
My dialog has groupboxes with slow to redraw controls, to improve the appearance I want to doublebuffer it. While I can use SetStyle() in the Dailogs constructor the setting change doesn't get...
23
by: Dennis Sjogren | last post by:
Hi! I have this medium sized solution with a couple of projects and stuff. The generated application has an <appname>.exe.manifest file to enable XP themes. In the main window of the application...
8
by: johnmmcparland | last post by:
Hi all, my program is trying to add group boxes with radio buttons at run time. While at one point it was able to draw the group boxes without the radio buttons, now it encounters problems just...
2
by: Saranya | last post by:
hi friends i want to perform a similar control as that of a group box in my web application.i m not at all comfortable with panel,html grid layout how to achieve this plz tell
4
by: shilpichaudhry | last post by:
Hi: I need to have controls in groupBox, which should not be clipped as per the size of the group box. so if they are longer, the control like a text box should appear (unclipped) Thanks,...
2
by: Lin Yi-Jian | last post by:
Dear All: I have a GroupBox1 in my form, and I add a TextBox1 to GroupBox1. I want to set some string to TextBox1,how can I do ?? my program: Dim tt as TextBox...
4
by: Gugale at Lincoln | last post by:
Hi, I am using reflection to read names from enum and creating radio buttons inside a groupbox. Everything is working fine. However, I am not able to adjust the size of the group box to fit the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.