winforms - Set groupbox invisible or make a shadow over it c# -
i seek understand how work groupboxes in windowsforms. question now. have 2 groupboxes 2 radiobuttons each one. want when illustration radiobutton 2 groupbox1 clicked whole groupbox2 invisible or improve set white shadow on , not allow user utilize it. read here did not find http://msdn.microsoft.com/en-us/library/system.windows.forms.groupbox.aspx. tried property visible create whole window invisible. here illustration code. in advance
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace groupbox { public partial class form1 : form { public form1() { initializecomponent(); radiobutton1.checked = true; radiobutton3.checked = true; } private void groupbox1_enter(object sender, eventargs e) { if (radiobutton4.checked == true) { this.visible = false; } } private void groupbox2_enter(object sender, eventargs e) { if (radiobutton2.checked == true) { this.visible = false; } } } }
also read can create groupbox invisible have it's contents visible? there anyway without panels?
try this:
public partial class form1 : form { public form1() { initializecomponent(); radiobutton1.checked = true; radiobutton3.checked = true; radiobutton2.checkedchanged += radiobutton2_checkedchanged; } void radiobutton2_checkedchanged(object sender, eventargs e) { groupbox2.enabled = !radiobutton2.checked; } }
c# winforms
No comments:
Post a Comment