GetNativeControl()

Gets the native .net control used to create this control.

Syntax
c#
public object GetNativeControl()
{ 
}

Parameters
none

Return Value
Returns a System.Object

Remarks
The GetNativeControl() method returns an instance of the native .net control used to create this control. This method was implemented so that the developer can get direct access to the properties and methods of the underlying control that are not currently implemented by the SGBControls Library.

Examples

c#
// Get the .net ListBox control and assign to the text property
public void ChangeTextOfListBox(SGBListBox control)
{
    if(control != null)
    {
          ListBox listBox = (ListBox)Control.GetNativeControl();
          listBox.Text = "This text was set via the native control";
    }
}

vb.net
' Get the .net ListBox control and assign to the text property
Public Sub ChangeTextOfListBox(ByVal control__1 As SGBListBox) 
    If control__1 IsNot Nothing Then 
        Dim listBox As ListBox = DirectCast(Control.GetNativeControl(), ListBox) 
        listBox.Text = "This text was set via the native control" 
    End If 
End Sub 

Known Issues
none

Last edited Mar 29, 2010 at 2:51 PM by scottgblood, version 4

Comments

No comments yet.