| | |
Taking Values from another form to Table layout panel ("How?")
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Solved Threads: 0
My aim is to get this value.
http://aycu40.webshots.com/image/467...4775269_rs.jpg
What is the best approch to do so ? Do i create a text box ? and place it in the (1,1) (Row, Column).
When do i want this number to appear ?
When the calculate button is hit.
http://aycu39.webshots.com/image/496...4054381_rs.jpg
So i guess the code should go there.
Methodology ? I dont want the number to appear just like that. Since ive built a user interface that number specifically depends on the value entered in NUD controller that ive changed its name to pd.
This value entered here.
http://aycu02.webshots.com/image/482...9274588_rs.jpg
now what i want to happen back in the form that ive changed its name to Common_Features , i mean this form
http://aycu40.webshots.com/image/467...4775269_rs.jpg
A mathematical operation to take place. The concept or the rule i want to use is 1/(whatever value is entered in the pd NUD)
So how do i implement the call function ? Call whatever value is entered in the NUD bring it up to current form then 1/value.
http://aycu40.webshots.com/image/467...4775269_rs.jpg
What is the best approch to do so ? Do i create a text box ? and place it in the (1,1) (Row, Column).
When do i want this number to appear ?
When the calculate button is hit.
http://aycu39.webshots.com/image/496...4054381_rs.jpg
So i guess the code should go there.
Methodology ? I dont want the number to appear just like that. Since ive built a user interface that number specifically depends on the value entered in NUD controller that ive changed its name to pd.
This value entered here.
http://aycu02.webshots.com/image/482...9274588_rs.jpg
now what i want to happen back in the form that ive changed its name to Common_Features , i mean this form
http://aycu40.webshots.com/image/467...4775269_rs.jpg
A mathematical operation to take place. The concept or the rule i want to use is 1/(whatever value is entered in the pd NUD)
So how do i implement the call function ? Call whatever value is entered in the NUD bring it up to current form then 1/value.
i didn't get the point... and please insert a picture (you can attach..use forum facility), don't give a link.
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 *
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Solved Threads: 0
Ok ill try to explain again.
As seen in the attachments Picture 4 shows you an interface ana a value = 0.25 in red.
I used a paint program to insert that number to tell exactly what i want.
Now inorder to get that number 0.25 what shall i add ? a label or text box ? Which is best ?.
Now i want that number to appear when the calculate button is clicked. ( See Picture 1 ).
The number 0.25 is a result of a caluclation that depends on another value form the NUD.
1.So i think i'll have to Declare one or more properties in the target form for the data that needs to be passed in. Then create the form object and then set the appropriate properties.
2. Declare a constructor in the target form and add a parameter for each value i want to pass in.
See the attachments for an animated GIF.
As seen in the attachments Picture 4 shows you an interface ana a value = 0.25 in red.
I used a paint program to insert that number to tell exactly what i want.
Now inorder to get that number 0.25 what shall i add ? a label or text box ? Which is best ?.
Now i want that number to appear when the calculate button is clicked. ( See Picture 1 ).
The number 0.25 is a result of a caluclation that depends on another value form the NUD.
1.So i think i'll have to Declare one or more properties in the target form for the data that needs to be passed in. Then create the form object and then set the appropriate properties.
2. Declare a constructor in the target form and add a parameter for each value i want to pass in.
See the attachments for an animated GIF.
1. if u just want to display i think label is better.
2. use public shared variable to pass value from one to another form.
2. use public shared variable to pass value from one to another form.
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 *
Ok.. see this example.
we have 2 form, you want to pass value from textboxt in form1 to label in form2.
in form 1 :
declare this code after windows generated code or before events.
in whatever event in form 1
in Form 2.
you just take the value in temp
we have 2 form, you want to pass value from textboxt in form1 to label in form2.
in form 1 :
declare this code after windows generated code or before events.
VB.NET Syntax (Toggle Plain Text)
Public Shared temp As String
in whatever event in form 1
VB.NET Syntax (Toggle Plain Text)
temp = textbox1.text
in Form 2.
you just take the value in temp
VB.NET Syntax (Toggle Plain Text)
label1.text = form1.temp
Last edited by Jx_Man; Mar 19th, 2008 at 6:16 pm.
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 *
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Solved Threads: 0
Edit:I am sending the value into one form then showing a different form.
Purpose is that the different form consists of 3 tables so i set them into buttons. each button will open a table.I can read many options in my mind. Do everything in the Calculation Button ?(form1) or Send values to second form then from second to third to mylabel ?
If you were in my place what approach will you use ?
Purpose is that the different form consists of 3 tables so i set them into buttons. each button will open a table.I can read many options in my mind. Do everything in the Calculation Button ?(form1) or Send values to second form then from second to third to mylabel ?
If you were in my place what approach will you use ?
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Solved Threads: 0
Ok heres what ive done. In form1 i had this code
Public Class Form1
and in the NUD controller i had this code
I was testing to see if im getting the correct value.
In the Second form i had a label.
and the following code
The problem was that the value was less than the NUD value by 1. And after i hit the back button and change the value of the NUD and hit the calculate button. The previous values remains so in my case the number 6 remains forever untill i terminate the program and run again.
Public Class Form1
VB.NET Syntax (Toggle Plain Text)
Public Shared Diametral_Pitch As String
and in the NUD controller i had this code
VB.NET Syntax (Toggle Plain Text)
Private Sub dp_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dp.ValueChanged Diametral_Pitch = dp.Text End Sub
I was testing to see if im getting the correct value.
In the Second form i had a label.
and the following code
VB.NET Syntax (Toggle Plain Text)
Private Sub second_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label1.Text = Form1.Diametral_Pitch End Sub End Class
The problem was that the value was less than the NUD value by 1. And after i hit the back button and change the value of the NUD and hit the calculate button. The previous values remains so in my case the number 6 remains forever untill i terminate the program and run again.
•
•
Join Date: Mar 2008
Posts: 28
Reputation:
Solved Threads: 0
Now i tried putting the code in the calculation Button
When i hit the calculate button i get the same exact number as in the NUD.
I hit the "back" button change the value of the NUD and hit the "Calculate" Button and no changes take effect. So now it works only for one time. i want to change infinite number of times.
VB.NET Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Diametral_Pitch = dp.Text second.Show() Me.Hide() End Sub
When i hit the calculate button i get the same exact number as in the NUD.
I hit the "back" button change the value of the NUD and hit the "Calculate" Button and no changes take effect. So now it works only for one time. i want to change infinite number of times.
no, you don't have to terminate program, just close form2 and open again cause code works in form load event. why you put label in form2 not in common feature form?
Last edited by Jx_Man; Mar 19th, 2008 at 7:37 pm.
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 *
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Storing Data from different file formats to a Database
- Next Thread: Retrieve System startup list
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2005 30minutes 2005 2008 access account application arithmetic array arrays basic binary bing button buttons c# center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dll dropdownlist error excel file-dialog folder ftp google hardcopy image images inline insert listview login math mobile ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save savedialog searchbox serial server soap sorting sql string table tcp text textbox timer toolbox trim update updown usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






