MS New Properties
This commit is contained in:
27
app/DD_PM_WINDREAM/ClassImageSelector.vb
Normal file
27
app/DD_PM_WINDREAM/ClassImageSelector.vb
Normal file
@@ -0,0 +1,27 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Drawing.Design
|
||||
Imports DD_PM_WINDREAM.InputProperties
|
||||
|
||||
Public Class ClassImageSelector
|
||||
Inherits UITypeEditor
|
||||
Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle
|
||||
Return UITypeEditorEditStyle.Modal
|
||||
End Function
|
||||
|
||||
Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object
|
||||
'Return MyBase.EditValue(context, provider, value)
|
||||
Dim oDialog = New OpenFileDialog
|
||||
If oDialog.ShowDialog() = DialogResult.OK Then
|
||||
If oDialog.FileName = "" Then
|
||||
value = "NONE"
|
||||
Else
|
||||
value = oDialog.FileName
|
||||
End If
|
||||
Else
|
||||
value = "No selection"
|
||||
End If
|
||||
|
||||
Return value
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user