HOW to New Button by Freebasic Code?

Windows specific questions.
Post Reply
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

HOW to New Button by Freebasic Code?

Post by xiaoyao »

MY CODE IS RIGHT?

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"
coderJeff
Site Admin
Posts: 4323
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: HOW to New Button by Freebasic Code?

Post by coderJeff »

Not sure what you are asking. Your code post is only a fragment of something bigger.

You think something should work but it doesn't?
Asking about a concept of some kind?

Moved to Windows forum.
Post Reply