- gtimepickercontrol.zip
- gTimePickerControl
- gTimePicker.zip
- gTimePicker
- gDateTimePicker.jpg
- gDateTimePickergValue.jpg
- gDateTimePickerNull.jpg
- gTimePickerAMPM.jpg
- gTimePickerColors.jpg
- gTimePickerExamples.jpg
- gTimePickerProps.jpg
- gTimePickerTimeColors.jpg
- Thumbs.db
|
Imports System.Windows.Forms.Design
Imports System.Drawing.Design
Imports System.ComponentModel
Class TimeUIEditor
Inherits UITypeEditor
' Indicate that we display a modal dialog.
Public Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As UITypeEditorEditStyle
Return UITypeEditorEditStyle.DropDown
End Function
' Edit a Selected value.
Public Overrides Function EditValue(ByVal context As ITypeDescriptorContext, _
ByVal provider As IServiceProvider, ByVal value As Object) As Object
' Get the editor service.
Dim editor_service As IWindowsFormsEditorService = _
CType(provider.GetService(GetType(IWindowsFormsEditorService)), _
IWindowsFormsEditorService)
If editor_service Is Nothing Then Return value
Using dropDownEditor As DropDowngTimeEditor = New DropDowngTimeEditor(editor_service)
' Prepare the editing dialog.
With dropDownEditor
If context.Instance.GetType Is GetType(gTimePickerCntrl) Then
Dim Instance As gTimePickerCntrl = CType(context.Instance, gTimePickerCntrl)
.DDgTimePickerCntrl.TimeAMPM = CType(Instance.TimeAMPM, gTimePickerCntrl.eTimeAMPM)
.DDgTimePickerCntrl.Hr24 = Instance.Hr24
.DDgTimePickerCntrl.TrueHour = Instance.TrueHour
.DDgTimePickerCntrl.Time = Instance.Time
.DDgTimePickerCntrl.TimeColors = Instance.TimeColors
' Display the dialog.
editor_service.DropDownControl(dropDownEditor)
ElseIf context.Instance.GetType Is GetType(gTimePicker) Then
Dim Instance As gTimePicker = CType(context.Instance, gTimePicker)
.DDgTimePickerCntrl.TimeAMPM = CType(Instance.TimeAMPM, gTimePickerCntrl.eTimeAMPM)
.DDgTimePickerCntrl.Hr24 = Instance.Hr24
.DDgTimePickerCntrl.TrueHour = Instance.TrueHour
.DDgTimePickerCntrl.Time = Instance.Time
.DDgTimePickerCntrl.TimeColors = Instance.TimeColors
' Display the dialog.
editor_service.DropDownControl(dropDownEditor)
End If
End With
' Return the new value.
If dropDownEditor.DDgTimePickerCntrl.Time = String.Empty Then
Return Nothing
Else
Return dropDownEditor.DDgTimePickerCntrl.Time & IIf(dropDownEditor.DDgTimePickerCntrl.TimeAMPM = gTimePickerCntrl.eTimeAMPM.PM, "P", "A").ToString
End If
End Using
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I first got hooked on programing with the TI994A. After it finally lost all support I reluctantly moved to the Apple IIe. Thank You BeagleBros for getting me through. I wrote programs for my Scuba buisness during this time. Currently I am a Database manager and software developer. I started with VBA and VB6 and now having fun with VB.NET/WPF/C#...