Docked Panel Update

Hello,

I have made a docked panel with a usercontrol form, i registered it to rhino

"

Protected Overrides Function OnLoad(ByRef errorMessage As String) As Rhino.PlugIns.LoadReturnCode
    If _userControl Is Nothing Then
        _userControl = New DockedPanelUserControl()
    End If
    ' Get SampleVbPanelUserControl class type
    Dim panelType As System.Type = GetType(DockedPanelUserControl)
    ' Register SampleVbPanelUserControl class type with Rhino
    Rhino.UI.Panels.RegisterPanel(Me, panelType, "PRONAVA", My.Resources.Pronava())
    Return (Rhino.PlugIns.LoadReturnCode.Success)

End Function
Dim dendun As DockedPanelUserControl = Nothing

End Class


I declare values to form but the panel stays the same.

Public Sub al()
    Dim oForm As New DockedPanelUserControl
    oForm.kutu.Text = 100
    MsgBox(oForm.kutu.Text)
End Sub

"

I get the 100 value from messagebox, but the docked panel textbox stays null. How can i update it?

I will be happy i could tell.

Thanks

This user control:

Dim dendun As DockedPanelUserControl = Nothing

and this one:

Dim oForm As New DockedPanelUserControl

are not the same objects. Thus, making a cahnge to oForm will not effect dendun.

Make a function on your plug-in that returns dendun so you can access it from some other location.

Does this help?

Hello,
Thanks,
I understand the problem

I made a function like below in my plugin class

    Public Shared Function getcontrol()
        Dim dendun As New DockedPanelUserControl()
        Return dendun
    End Function

And i tried to reach it with the sub below

    Public Sub al(ByRef erdem As Object)
        Dim oform
        oform = DockedPanelPlugIn.getcontrol()
        oform.kutu.Text = 100
        MsgBox(oform.kutu.Text)
    End Sub

But couldnt succeed, it says “oform has no common member as kutu” Probably i didnt understand you.

Thanks for your interest

Please review the following example:

https://github.com/dalefugier/SampleCsPanel

For Visual Basic, see this: