I have just started learning Basic, and i know you can create command butons from the virtual environment, but how do you create (and, more importantly, let the user drag around) them from code?
ben25x
12
Light Poster
Recommended Answers
Jump to PostTry this one....
Creating a button
Private Sub Form_Load() Dim Com As CommandButton Set Com = Me.Controls.Add("vb.commandbutton", "BtnName") With Com .Left = 1000 .Top = 3000 .Width = 5000 .Height = 1000 .Visible = True .Caption = "My Button" End With End Sub
Moving a button.....
…
Jump to PostDear P.manidas little bit problem with you code is in first code u created command button, and with other code u are trying to drag a command button that is created in desgen mode, for event controlin you need to define command button in general property of project with clause …
All 6 Replies
debasisdas
580
Posting Genius
Featured Poster
P.manidas
39
Posting Whiz in Training
trilok31
8
Newbie Poster
ben25x
commented:
it fit the requirements on spot
+1
P.manidas
commented:
Nice
+3
P.manidas
39
Posting Whiz in Training
trilok31
8
Newbie Poster
AndreRet
commented:
Well done
+7
ben25x
12
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.