943,947 Members | Top Members by Rank

Ad:
Sep 5th, 2007
0

convert string into object

Expand Post »
dim a as checkbox
dim b as string

b= "check1"

a=b

this code give me error.

is ther any fuction to convert string into an object ? like cstr().
or what is the procedure to convert a string into an object ?
plz help me.

i need help
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pranto157 is offline Offline
20 posts
since May 2007
Sep 5th, 2007
0

Re: convert string into object

Hi,
I think u r trying to create a checkbox on runtime and give it the name stored in variable b. if so below is the code to do it:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2.  
  3. Dim a As CheckBox
  4. Dim b As String
  5.  
  6. b = "check1"
  7.  
  8. Set a = Controls.Add("VB.CheckBox", b)
  9.  
  10. With a
  11. .Visible = True
  12. .Caption = b
  13. .Top = 50
  14. .Left = 50
  15. End With
  16.  
  17. End Sub
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Excel & VB
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Form that maintains a table by reading a second table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC