groupbox

How can I change the border thickness of a Groupbox on a windows form in C#?

ⅰ亾dé卋堺 提交于 2019-12-01 18:31:49
I didn't find any solution that helped me on the older questions on SO... Is it possible to make them thicker or just more visible by changing the color? If yes, some code would be great... or just a hint how to do it... You'll need to make a custom GroupBox control. See The Grouper - A Custom Groupbox Control GroupBox is a custom drawn .Net control. You will need to hook into the Paint event, or derive from the GroupBox and override the OnPaint method, determine where the existing lines are being drawn and then draw overtop of them with wider lines to achieve the thicker border. Or you can

Why does Windres report a syntax error on my GROUPBOX statement?

你离开我真会死。 提交于 2019-12-01 18:31:20
I'm experimenting with the Win32 API in C++, specifically with writing resource files. Now, my entire project was working just fine, menus and titles and everything. However, when I add this code for a modal dialog box to the .rc file: IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "My About Box" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "&OK",IDOK,174,18,50,14 PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14 GROUPBOX "About this program...",IDC_STATIC,7,7,225,52 CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby

Android Check box Group

99封情书 提交于 2019-12-01 14:39:23
问题 I'm trying to apply some kind of validation on a group of check boxes (e.g. Two contradictory items cannot be checked together) so I want to somehow group Check Box objects and apply something like RequiredFieldValidator on the whole group once and in that validator I will register listeners and do the whole check on my Check Boxes objects. What I imagine would be a code that look like that: CheckBoxView allMyCheckBoxes = new CheckBoxView(checkbox1,checkbox2,checkbox3); //varargs validate

WPF GroupBox Header Customization

佐手、 提交于 2019-12-01 10:58:35
I have edited the standard GroupBox template as I wanted to customize it. Apart from other customizations, I wanted the GroupBox header to be Horizantally aligned in the Center instead of Left or Right. The alignment of the Header is not a problem however, the real problem is the OpacityMask defined for the Border controls. The opacity mask sets the transparent space behind the groupbox header where the borders are not drawn. I haven't able to figure it out how to place the transparent space / gap behind the groupbox header when I set the header to the center. Here is how my XAML looks like:

Custom GroupBox with custom TextColor, BorderColor and Transparent BackColor

北城余情 提交于 2019-12-01 02:55:58
问题 I'm using WinForms . In my form I have a GroupBox . This is a custom group box. I wanted a transparent background for the groupbox . I'm having issues creating a transparent background for the groupbox The problem with this code is i keep on getting an error when i set the group box backcolor to transparent. Error: Control does not support transparent background colors. g.Clear(BackColor = Color.Transparent); (This is the line that is giving me the problem) private void DrawGroupBox(GroupBox

Does the GroupBox Header in WPF swallow mouse-clicks?

流过昼夜 提交于 2019-11-29 21:22:44
Have a look at this very simple example WPF program: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <GroupBox> <GroupBox.Header> <CheckBox Content="Click Here"/> </GroupBox.Header> </GroupBox> </Window> So I have a GroupBox whose header is a CheckBox. We've all done something like this - typically you bind the content of the GroupBox in such a way that it's disabled when the CheckBox is unchecked. However, when I run this application and

Method to reset members inside groupBox

孤人 提交于 2019-11-29 18:12:20
is there any method for groupBox to clear all properties of objects inside groupBox. for example clear all textboxes, deselect all checkboxes etc. and set them to default. or i should code one by one to clear them? i want to do this on event listview SelectedIndexChanged. Update: ok thanks for replays, i found that you can select controls inside groupbox very simple. foreach (Control ctrl in groupBox2.Controls)//this will only select controls of groupbox2 { if (ctrl is TextBox) { (ctrl as TextBox).Text = ""; } if (ctrl is CheckBox) { (ctrl as CheckBox).Checked = false; } if (ctrl is ComboBox)

Change group box text color?

家住魔仙堡 提交于 2019-11-29 10:48:18
How do you change the text color of a group box in C#? The "documentation" doesn't even mention this, and Googling hasn't turned up an answer. Thanks! Alan Use the ForeColor property. Sample code: using System; using System.Drawing; using System.Windows.Forms; class Test { [STAThread] static void Main(string[] args) { Form form = new Form(); GroupBox group = new GroupBox(); group.Text = "Text"; group.ForeColor = Color.Red; form.Controls.Add(group); Application.Run(form); } } Actually all the answers posted here changes the forecolor of other controls like button, label etc residing inside the

How do you change the color of the border on a group box?

雨燕双飞 提交于 2019-11-29 01:12:18
In C#.NET I am trying to programmatically change the color of the border in a group box. Update: This question was asked when I was working on a winforms system before we switched to .NET. Mick Bruno Building on the previous answer, a better solution that includes the label for the group box: groupBox1.Paint += PaintBorderlessGroupBox; private void PaintBorderlessGroupBox(object sender, PaintEventArgs p) { GroupBox box = (GroupBox)sender; p.Graphics.Clear(SystemColors.Control); p.Graphics.DrawString(box.Text, box.Font, Brushes.Black, 0, 0); } You might want to adjust the x/y for the text, but

Does the GroupBox Header in WPF swallow mouse-clicks?

雨燕双飞 提交于 2019-11-28 17:02:08
问题 Have a look at this very simple example WPF program: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <GroupBox> <GroupBox.Header> <CheckBox Content="Click Here"/> </GroupBox.Header> </GroupBox> </Window> So I have a GroupBox whose header is a CheckBox. We've all done something like this - typically you bind the content of the GroupBox in