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: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Taking Values from another form to Table layout panel ("How?")

 
0
  #1
Mar 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #2
Mar 19th, 2008
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 *
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #3
Mar 19th, 2008
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.
Attached Thumbnails
4.jpg   1.jpg   12xp5.gif  
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #4
Mar 19th, 2008
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.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #5
Mar 19th, 2008
Thanx , i'll create a label.
But im not quite sure how to pass Values.

May you help me please ?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #6
Mar 19th, 2008
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.
  1. Public Shared temp As String

in whatever event in form 1
  1. temp = textbox1.text

in Form 2.
you just take the value in temp
  1. 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 *
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #7
Mar 19th, 2008
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 ?
Attached Thumbnails
2.jpg  
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #8
Mar 19th, 2008
Ok heres what ive done. In form1 i had this code

Public Class Form1
  1. Public Shared Diametral_Pitch As String

and in the NUD controller i had this code

  1. Private Sub dp_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dp.ValueChanged
  2. Diametral_Pitch = dp.Text
  3. 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

  1. Private Sub second_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. Label1.Text = Form1.Diametral_Pitch
  3. End Sub
  4. 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.
Attached Thumbnails
1.jpg   2.jpg  
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 28
Reputation: Beginner2008 is an unknown quantity at this point 
Solved Threads: 0
Beginner2008 Beginner2008 is offline Offline
Light Poster

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #9
Mar 19th, 2008
Now i tried putting the code in the calculation Button


  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Diametral_Pitch = dp.Text
  3. second.Show()
  4. Me.Hide()
  5.  
  6. 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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Taking Values from another form to Table layout panel ("How?")

 
0
  #10
Mar 19th, 2008
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 *
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC