示例#1
0
		private void PerformToggle (SWF.CheckBox checkbox, SWF.CheckState state)
		{
			if (checkbox.InvokeRequired == true) {
				checkbox.BeginInvoke (new PerformToggleDelegate (PerformToggle),
				                      new object [] { checkbox, state });
				return;
			}

			// NOTE: We can count on presence of InvokeOnClick;
			//       it is a protected member of CheckBox.
			//
			//       This basically simulates a click, which always
			//       raises the Click event, but strangely does not
			//       raise CheckChanged when transitioning to
			//       Indeterminate state. This matches MS behavior.
			MethodInfo invokeOnClick =
				typeof (SWF.CheckBox).GetMethod ("InvokeOnClick",
				                                 BindingFlags.NonPublic |
				                                 BindingFlags.Instance);
			invokeOnClick.Invoke (checkbox,
			                      new object [] {checkbox, EventArgs.Empty});
		}
示例#2
0
		private void PerformSetVisualState (SWF.Form form, SWF.FormWindowState state)
		{
			if (form.InvokeRequired == true) {
				form.BeginInvoke (new PerformSetVisualStateDelegate (PerformSetVisualState),
				                  new object [] { form, state });
				return;
			}
			form.WindowState = state;
		}
		private void PerformSelectDelegate (SWF.RadioButton radioButton)
		{
			if (radioButton.InvokeRequired == true) {
				radioButton.BeginInvoke (new PerformSelectDelegate (PerformSelectDelegate),
				                         new object [] { radioButton });
				return;
			}
			radioButton.Checked = true;
		}
		private void PerformExpandOrCollapse (SWF.ComboBox combobox, bool droppedDown)
		{
			if (combobox.InvokeRequired == true) {
				combobox.BeginInvoke (new PerformExpandOrCollapseDelegate (PerformExpandOrCollapse),
				                      new object [] { combobox, droppedDown } );
				return;
			}
			combobox.DroppedDown = droppedDown;
		}