Code: Select all
Function NewControl(ByVal ControlClass As String, ControlName As String, Text As String,Left2 As Long,Top2 As Long ) As .hWnd
'.hWnd CHANGE TO HWND
Dim hWndControl As .hWnd
'Dim pWindow As CWindow Ptr = New CWindow("CWindowNew")
hWndControl = pWindow2->AddControl(ControlClass, Me.hWnd, 102, Text, Left2, Top2, 200, 30, WS_CHILD Or WS_CLIPSIBLINGS Or ES_LEFT Or WS_VISIBLE Or ES_AUTOHSCROLL Or WS_TABSTOP Or ES_WANTRETURN, WS_EX_CLIENTEDGE,, Cast(Any Ptr, @Form2_CODEPROCEDURE))
Return hWndControl
End Function
Dim ObjHwnd As .hWnd, Button4 As Class_Button
ObjHwnd = NewControl("BUTTON", "ButtonX", "'new Button", 0, 0)
Button4.hWnd =ObjHwnd
MsgBox("Button4.Caption=" & Button4.Caption)
Button4.Caption = "New Button XXX"