> In that case, you can use reflection to determine to look for the Editor
> attribute for a class, create an instance of the editor, and call the
> EditValue and GetEditStyle methods yourself while supplying the needed
> parameters.
>
> Bryan Phillips
> MCSD, MCDBA, MCSE
> Blog:
http://bphillips76.spaces.live.com >
>
>
>
> "Yuri O" <a@b.com> wrote in message
> news:eZkF6Z1#GHA.2300@TK2MSFTNGP04.phx.gbl:
>
>> Thanks Bryan
>>
>> It's interesting sample however I was wondering how to use UITypeEditors
>> explicitly i.e. without Propertygrid, let us say on-place in conjunction
>> with standard controls on a Form.
>>
>> Thanks much!
>> Yuri
>>
>> "Bryan Phillips" <bphillips@nospam.crowechizek.com.spammenot> wrote in
>> message news:uyXeoKh%23GHA.4388@TK2MSFTNGP02.phx.gbl...
>>
>> > Here is a simple example to bring up a PageSettings dialog for a
>> > property
>> > that returns PageSettings
>> >
>> > Public Class PageSettingsEditor
>> > Inherits System.Drawing.Design.UITypeEditor
>> >
>> > Public Overrides Function EditValue(ByVal context As
>> > System.ComponentModel.ITypeDescriptorContext, ByVal provider As
>> > System.IServiceProvider, ByVal value As Object) As Object
>> > Dim dialog As New System.Windows.Forms.PageSetupDialog()
>> >
>> > ' If PageSettings is null, calling ShowDialog will throw an
>> > exception.
>> > If value Is Nothing Then
>> > dialog.PageSettings = New
>> > System.Drawing.Printing.PageSettings()
>> > Else
>> > dialog.PageSettings = CType(value,
>> > System.Drawing.Printing.PageSettings)
>> > End If
>> >
>> > ' If they clicked OK, return the new value
>> > If dialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
>> > Return dialog.PageSettings
>> > End If
>> >
>> > ' They did not click OK so don't change the value
>> > Return value
>> > End Function
>> >
>> > Public Overrides Function GetEditStyle(ByVal context As
>> > System.ComponentModel.ITypeDescriptorContext) As
>> > System.Drawing.Design.UITypeEditorEditStyle
>> > Return Drawing.Design.UITypeEditorEditStyle.Modal
>> > End Function
>> > End Class
>> >
>> > On the property use the EditorAttribute class:
>> >
>> > Public Class MyClass
>> > <Category("Print Setup")> _
>> > <Description("The collection of page settings.")> _
>> > <EditorBrowsable(EditorBrowsableState.Always)> _
>> > <EditorAttribute(GetType(PageSettingsEditor),
>> > GetType(Drawing.Design.UITypeEditor))> _
>> > Public Property PageSettings() As PageSettings
>> > Get
>> > Return _pageSettings
>> > End Get
>> > Set(ByVal value As PageSettings)
>> > _pageSettings = value
>> > End Set
>> > End Property End Class
>> >
>> > Bryan Phillips
>> > MCSD, MCDBA, MCSE
>> > Blog:
http://bphillips76.spaces.live.com >> >
>> >
>> >
>> > "Yuri O" <a@b.com> wrote in message
>> > news:uGAIHEg#GHA.5092@TK2MSFTNGP04.phx.gbl:
>> >
>>
>> >> Hello guys
>> >>
>> >> Could you give me a clue how to explicitly use in code UI designers
>> >> like
>> >> ImageEditors ( FontEditors, IconEditor) etc. like what the PropertGrid
>> >> does?
>> >> I just want to implement some kind of light-weight propeditor but
>> >> definitely
>> >> cannot imagine how to engage this functionality.
>> >> Probably there is any samples or any code related to such behavior...
>> >> ?
>> >> Any help will be greatly appreciated :)
>> >> --
>> >> Thanks
>> >> - Yuri
>>
>> >
>