次の方法で共有


OlkTimeControl Interface

A control that displays the Outlook time drop-down menu.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<GuidAttribute("000672EF-0000-0000-C000-000000000046")> _
<CoClassAttribute(GetType(OlkTimeControlClass))> _
Public Interface OlkTimeControl _
    Inherits _OlkTimeControl, OlkTimeControlEvents_Event
'Usage
Dim instance As OlkTimeControl
[GuidAttribute("000672EF-0000-0000-C000-000000000046")]
[CoClassAttribute(typeof(OlkTimeControlClass))]
public interface OlkTimeControl : _OlkTimeControl, 
    OlkTimeControlEvents_Event

Remarks

This is a .NET interface derived from a COM coclass that is required by managed code for interoperability with the corresponding COM object. Use this derived interface to access all method, property, and event members of the COM object. However, if a method or event you want to use shares the same name under the same COM object, cast to the corresponding primary interface to call the method, and cast to the latest events interface to connect to the event. Refer to this topic for information about the COM object. For information about the method and property members of the COM object, see _OlkTimeControl. For information about the event members of the COM object, see OlkTimeControlEvents_Event.

Before you use this control for the first time in the forms designer, add the Microsoft Outlook Time Control to the control toolbox. You can only add this control to a form region in an Outlook form using the forms designer; you cannot add this control to a Visual Basic UserForm object in the Visual Basic Editor.

The time control has several different modes which are exposed via properties on the control. It can be bound to any DateTime property, and can be bound to the same property as a date control to provide the capability to select both date and time.

The following is an example of the time control at runtime. This control supports Microsoft Windows themes.

If the Click event is implemented but the DropButtonClick event is not implemented, then clicking the drop button will fire only the Click event.

If you bind the time control to the start time or the end time of an appointment item, you must use an add-in to control enabling and disabling of the time control. In particular, when the user sets the appointment as an all-day event, you must use code to disable the time controls for the start time and the end time, and enable the controls only when the user clears this setting.

For more information about Outlook controls, see Controls in a Custom Form. For examples of add-ins in C# and Visual Basic that use Outlook controls, see code sample downloads on MSDN.

See Also

Reference

OlkTimeControl Members

Microsoft.Office.Interop.Outlook Namespace