本文整理汇总了C#中System.Windows.Forms.CheckedListBox.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# CheckedListBox.Dispose方法的具体用法?C# CheckedListBox.Dispose怎么用?C# CheckedListBox.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.CheckedListBox
的用法示例。
在下文中一共展示了CheckedListBox.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditValue
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
TrackBarOwnerDrawParts none = TrackBarOwnerDrawParts.None;
if (!(value is TrackBarOwnerDrawParts) || (provider == null))
return value;
IWindowsFormsEditorService service = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService));
if (service == null)
return value;
CheckedListBox control = new CheckedListBox();
control.BorderStyle = System.Windows.Forms.BorderStyle.None;
control.CheckOnClick = true;
control.Items.Add("Ticks", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Ticks) == TrackBarOwnerDrawParts.Ticks);
control.Items.Add("Thumb", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Thumb) == TrackBarOwnerDrawParts.Thumb);
control.Items.Add("Channel", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Channel) == TrackBarOwnerDrawParts.Channel);
service.DropDownControl(control);
IEnumerator enumerator = control.CheckedItems.GetEnumerator();
while (enumerator.MoveNext())
{
object objectValue = RuntimeHelpers.GetObjectValue(enumerator.Current);
none |= (TrackBarOwnerDrawParts) Enum.Parse(typeof(TrackBarOwnerDrawParts), objectValue.ToString());
}
control.Dispose();
service.CloseDropDown();
return none;
}
示例2: EditValue
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
TrackBarOwnerDrawParts barOwnerDrawParts = TrackBarOwnerDrawParts.None;
if (!(value is TrackBarOwnerDrawParts) || provider == null)
return value;
IWindowsFormsEditorService formsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (formsEditorService == null)
return value;
CheckedListBox checkedListBox = new CheckedListBox();
checkedListBox.BorderStyle = BorderStyle.None;
checkedListBox.CheckOnClick = true;
checkedListBox.Items.Add((object)"Ticks", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Ticks) == TrackBarOwnerDrawParts.Ticks);
checkedListBox.Items.Add((object)"Thumb", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Thumb) == TrackBarOwnerDrawParts.Thumb);
checkedListBox.Items.Add((object)"Channel", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Channel) == TrackBarOwnerDrawParts.Channel);
formsEditorService.DropDownControl((Control)checkedListBox);
foreach (object obj in checkedListBox.CheckedItems)
{
object objectValue = RuntimeHelpers.GetObjectValue(obj);
barOwnerDrawParts |= (TrackBarOwnerDrawParts)Enum.Parse(typeof(TrackBarOwnerDrawParts), objectValue.ToString());
}
checkedListBox.Dispose();
formsEditorService.CloseDropDown();
return (object)barOwnerDrawParts;
}
示例3: EditValue
public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
{
if (value != typeof(Corners) || provider == null)
return value;
IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (edSvc != null)
{
CheckedListBox lb = new CheckedListBox();
lb.BorderStyle = BorderStyle.None;
lb.CheckOnClick = true;
lb.Items.Add("TopLeft", (((CustomButton)context.Instance).RoundCorners & Corners.TopLeft) == Corners.TopLeft);
lb.Items.Add("TopRight", (((CustomButton)context.Instance).RoundCorners & Corners.TopRight) == Corners.TopRight);
lb.Items.Add("BottomLeft", (((CustomButton)context.Instance).RoundCorners & Corners.BottomLeft) == Corners.BottomLeft);
lb.Items.Add("BottomRight", (((CustomButton)context.Instance).RoundCorners & Corners.BottomRight) == Corners.BottomRight);
edSvc.DropDownControl(lb);
Corners cornerFlags = Corners.None;
foreach (object o in lb.CheckedItems)
{
cornerFlags = cornerFlags | (Corners)Enum.Parse(typeof(Corners), o.ToString());
}
lb.Dispose();
edSvc.CloseDropDown();
return cornerFlags;
}
return value;
}