|
-
Jan 11th, 2008, 05:15 AM
#1
Thread Starter
New Member
[2005] Get value From form called by User Control
Hi,
I have a User Control (with user properties ) and form in one project. From a button on the User Control I open the form. I want when i close the form (with the red X on right top of the form) to get a value from the form (from a textbox for example, filled by user) and send it to the property of the user control.
(I make it work but with custom button on form , timers and flags, and i don't think that's the way. And i need to use the standard close button ) Any help is welcome. Thanks in advance.
-
Jan 11th, 2008, 10:14 AM
#2
Lively Member
Re: [2005] Get value From form called by User Control
 Originally Posted by bullzzeye
Hi,
I have a User Control (with user properties ) and form in one project. From a button on the User Control I open the form. I want when i close the form (with the red X on right top of the form) to get a value from the form (from a textbox for example, filled by user) and send it to the property of the user control.
(I make it work but with custom button on form , timers and flags, and i don't think that's the way. And i need to use the standard close button ) Any help is welcome. Thanks in advance.
You can use the FormClosing event of your form.
vb.net Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
myUserControl.SomeProperty = Textbox1.Text
End Sub
-
Jan 11th, 2008, 02:23 PM
#3
Thread Starter
New Member
Re: [2005] Get value From form called by User Control
This doesn't work for me. I can't get access to user control properties.
From User Control I open the form with
When I try in Form1
Code:
UserControl. ......
no properties of the user control.
Maybe i open the form wrong way
Last edited by bullzzeye; Jan 12th, 2008 at 01:54 AM.
-
Jan 11th, 2008, 02:26 PM
#4
Frenzied Member
Re: [2005] Get value From form called by User Control
http://www.windowsitlibrary.com/Content/1085/09/3.html
The navigation numbers are at the bottom of the page. Read the whole article.
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
|