Hi, I have multiple Controls grouped in Groupboxes. I want to select the control from groupbox dynamically. For example, I am able to select the controls from GroupBox1 with the code below. However, I want to make it dynamically so that users can select any controls from any GroupBox. Would appreciate your help and suggestion. Thank you. Private Sub addSelectedClickHandlers() Try For Each selectedControl As Control In GroupBox1.Controls AddHandler selectedControl.MouseMove, AddressOf selectedControl_MouseMove AddHandler selectedControl.MouseLeave, AddressOf selectedControl_MouseLeave Next Catch ex As Exception Debug.Print(ex.ToString) End Try End Sub

Member Avatar
Member Avatar
+0 forum 1

Hmm, normally, I just cut all those controls out and delete the GroupBox. But, it's not easy all the time, so me just wondering if there was a way to do it without touching the child controls. Remove the relationship? Or other otions?

Member Avatar
Member Avatar
+0 forum 12

Is it possible to iterate using foreach loop on multiple groupBox. I have 6 GroupBox named as gBox1,gBox2,gBox3,gBox4,gBox5,gBox6 AND each gBox contain 21 ComboBox named as slot1,slot2,slot3,slot4,slot5.... so on out of which I want to select only 7 comboBoxes for operation. For eaxmple if user enter 2 in textbox then from gBox1->cb15,slot1,slot2,slot3,slot4,slot5,slot6,slot7 and from gBox2->slot8,slot9,slot10,slot11,slot12,slot13 text of all comboBox should be stored in a string array. Now problem is I am able to Iterate on ComboBox like this if (no_of_period == 2) { if (duration == 1) { foreach (var comboBox in gBox2.Controls.OfType<ComboBox>().OrderBy(m => m.Name)) { if (comboBox.Name.Substring(0, 4).Equals("slot")) { …

Member Avatar
Member Avatar
+0 forum 4

Hello Daniwebbers I have a 2 dimentional control array which gets added to it programatically. There's a lot to add to it but i have already stumbled at the first hurdle. I keep getting the standard "Object reference not set to an instance of an object." error when the first control is added. Control array is initialised: Control[ ][ ] TControls = new Control[6][]; Controls are added: t = 1; TControls[t][1] = new GroupBox(); TControls[t][1].Visible = false; TControls[t][1].Parent = gbtasks; TControls[t][1].Name = "t" + (t + 1).ToString(); TControls[t][1].ForeColor = Color.SeaGreen; TControls[t][1].Text = (t + 1).ToString(); TControls[t][1].Size = new Size(262, 42); …

Member Avatar
Member Avatar
+0 forum 4

I have GroupBox that is populated by Button controls, and a combobox that populates the groupBox based on the selected number in combobox(8, 16, 32). This is my populateGroupbox method private void populateGroupbox (GroupBox gBox, int number ) { for (int i = 0; i < number; i++) { Button btn = new Button(); btn.Location = new Point(16, 30 + i*30); btn.Text = (i + 1).ToString(); btn.Width = 40; gBox.Controls.Add(btn); Application.DoEvents(); } } Based on the number param in that method it adds that many buttons. Now here is my problem, if i select 16 or 32 controls kinda spill …

Member Avatar
Member Avatar
+0 forum 1

I'm doing a program which consists on a Test, with the following structure: 1. Question 1 rdioBtn 1 rdioBtn2 rdioBtn 3 2. Question 2 rdioBtn 4 rdio Btn 5 rdioBtn6 And so on... Each question is inside of a groupbox. What I wanna do, is to disable my "Next" button, until every question has one radio button checked. Any idea how?

Member Avatar
Member Avatar
+0 forum 7

What would be the best approach to create the following: A groupbox that contains several labels a groupbox with an array of 8 labels in it Then the main form would have 4 of these groupboxs (object?) and I would need the ability to change the color and text of all the various labels within any of the groupboxes, using an index similar to what we could do with control arrays in VB6. I would think an object would make the most sense but can you have control elements in an object and display them on the form?

Member Avatar
Member Avatar
+0 forum 4

I have read [URL="http://bytes.com/topic/c/answers/891582-radio-button-groupbox-not-generating-wm_command"]http://bytes.com/topic/c/answers/891582-radio-button-groupbox-not-generating-wm_command[/URL] but when I try: [CODE] hwndFrame = CreateWindow( "BUTTON", "Test", WS_CHILD | WS_VISIBLE | BS_GROUPBOX | WS_CLIPCHILDREN, 304, 112, 233, 63, hwnd, NULL, g_hInst, 0); if(hwndFrame == NULL) return 0; hwndBtnCerrar = CreateWindow( "BUTTON", "Close", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 20, 20, 103, 17, hwndFrame, (HMENU)IDBTNCERRAR, g_hInst, 0); if (hwndBtnClose == NULL) return 0; GroupBoxProc = (WNDPROC)GetWindowLongPtr(hwndFrame, GWLP_WNDPROC); SetWindowLongPtr(hwndFrame, GWLP_WNDPROC, (LONG_PTR)(GroupRelay)); [/CODE] The button works fine, but I the problem it's that is was all in vain because the frame doesn't appear, so how could I do to see the Group Box and enable the "Close" button? Any help would …

Member Avatar
+0 forum 0

I have a C# App with a form which has a groupbox containing many controls. I have the groupbox anchored Top/Bottom/Left/Right to ensure that it sizes appropriately to the users screen resolution. This app was developed on a machine running Windows XP and it has been working flawlessly for over a year on multiple XP boxes. Now, our company is converting boxes to Windows 7. I've tested the app on 2 of the converted boxes and in both cases the groupbox refuses to auto anchor properly to the right and bottom. The form itself autosizes to full screen as you …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys, i have this code which draws a continuous circle using a timer. Now I have to display it in the form which has a group box with loads of other fields and information. Now can anyone please tell me how can i add the circle into the group box as it can be displayed. Currently the circle is being displayed behind the group box which is not visible. Thank you so much Ashwin [CODE]Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick Me.sweepAngle += 1 If Me.sweepAngle = 360 Then Me.Timer1.Stop() End If Me.Refresh() End …

Member Avatar
Member Avatar
+0 forum 2

The End.