|
-
Apr 8th, 2000, 11:36 AM
#1
Thread Starter
New Member
I am creating an ActiveX control. In this control when a button is pressed I want a window to show with a textbox and a button. when the button in the window is pressed I want the window to hide itself and the a textbox on the user control to equal the text in the window's textbox. I have tried adding a form to an ActiveX control project to do this but I can not get the text to transfer. If anyone out there knows how to do the above I would greatly appreciate it.
vbMichael
-
Apr 8th, 2000, 09:09 PM
#2
Lively Member
try this...
behind control button:
form2.show vbmodal
textbox.text = form2.textbox.text
behind form2 button:
me.hide
-
Apr 8th, 2000, 09:55 PM
#3
Thread Starter
New Member
With the code suggested it makes the text the same before the form is shown I need to make the text the same when the button on the form is pressed then hide the form. with what I have tried I can't change any control's properties or user control properties through the form. Any way I can do this?
-
Apr 8th, 2000, 10:29 PM
#4
Lively Member
are you putting vbmodal after form.show?
-
Apr 9th, 2000, 02:29 AM
#5
Thread Starter
New Member
Yes I am putting vbmodal after the show method of the form.
-
Apr 9th, 2000, 03:18 AM
#6
Lively Member
let's see if we are on the same page here. This is what i am doing.
1. creating new AX control
2. adding textbox and command button to control
3. adding form1 to project
4. behind AX command1:
form1.show vbmodal
text1.text = form1.text1.text
5. behind form1.command1
me.hide
-
Apr 9th, 2000, 04:37 AM
#7
Thread Starter
New Member
That is correct with one addition. When the form's command button is clicked the textbox's text (the one on the AX control) will be set to the text in the form's textbox.
-
Apr 9th, 2000, 05:49 AM
#8
Lively Member
ok, try this. add form as before, in the AX click put:
Dim frm As New Form1
frm.Text1.Text = Text1.Text
frm.Show vbModal
Text1.Text = frm.Text1.Text
Set frm = Nothing
in form1.command1 click put
me.hide
-
Apr 9th, 2000, 05:58 AM
#9
Thread Starter
New Member
your code works fine but I found you don't need to create a new instance of form1. Is there a reason for it?
Thank you
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
|