|
-
June 14th, 2001, 11:21 PM
#1
UserControl
Hi!
I need help for user control.
On "user control" I have ListBox.
I want to access that list box in form which is included in same usercontol. I wrote some code but it is giving error. error'424' bject requried.
Usercontrol(test.ctl) code
Private Sub UserControl_Initialize()
Load Form1
List1.AddItem "A", "0"
List1.AddItem "K", "1"
List1.AddItem "G", "2"
List1.AddItem "R", "3"
End Sub
Private Sub cmdbutton_Click()
Form1.Show vbmodel,me
End Sub
Form1
Private Sub Form_Load()
txttest.value=test.list1.text
(Nameof usercontrol.controlname.property)
End Sub
I am not able to refernce the component from usercontrol.
Thanks,
Anita
-
June 14th, 2001, 11:33 PM
#2
Re: UserControl
if the list box is in the form, should you write
form1.list1.additem
instead ?
cksiow
http://vblib.virtualave.net - share our codes
-
June 15th, 2001, 12:44 AM
#3
Re: UserControl
I think you need writing function in UserControl.
In user control write:
Public Function RetProp() As String
RetProp = List1.Text
End Function
In form use:
txttest.value = test.RetProp()
P.S. In listbox properties Text return zero lenght value string
Andy Tower
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|