A runtime form designer control

FormDesigner.CurrentToolType Property

Get / Set the type of component that will be instantiated when the user drag draws on the FormDesigner in design mode.

[Visual Basic]
Public Property CurrentToolType As Type
[C#]
public Type CurrentToolType { get; set; }
[C++]
public: __property Type* get_CurrentToolType();
public: __property void set_CurrentToolType(Type* );
[JScript]
public function get CurrentToolType() : Type
public function set CurrentToolType(Type);

Remarks

While in design mode, you can instantiate a new component by drag and draw mechanism. For this, you need to set appropriate tool information through CurrentToolType property.

From drag and draw mode, the FormDesigner can be switched back to draw and select by setting CurrentToolType to null (nothing in VB.Net).

This property is not available at design time.

Example

Following example demonstrates how to specify a type as current tool type.

[C#]
private void UpdateCurrentTool(Type typ) 
{
    designer.CurrentToolType = typ;
}
[Visual Basic]
Private Sub UpdateCurrentTool(ByVal typ As Type) 
   designer.CurrentToolType = typ;
End Sub

See Also

FormDesigner Class | Viklele.Win.Designer Namespace