| | |
adding objects at runtime
![]() |
Hi
Example to adding control at runtime
Example to adding control at runtime
VB Syntax (Toggle Plain Text)
Option Explicit ' Declare object variable as CommandButton. Private WithEvents cmdObject As CommandButton Private Sub Form_Load() Set cmdObject = Form1.Controls.Add("VB.CommandButton", "cmdOne") cmdObject.Visible = True cmdObject.Caption = "Dynamic CommandButton" End Sub Private Sub cmdObject_Click() MsgBox "This is a dynamically added control" End Sub
Last edited by selvaganapathy; May 30th, 2008 at 9:33 am.
KSG
Yes u can, i think selvaganapathy was given the best answer
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- Creating special classes (Java)
- Source Code that don't work? (Java)
- newInstance() / Loading Classes During Runtime (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: vb6 newbie needing some help
- Next Thread: Cyrillic into VB6
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






