| | |
adding objects at runtime
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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.
Selva 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
Views: 1111 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column 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 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 retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






