Related to Forms Property

Reply

Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

Related to Forms Property

 
0
  #1
Jun 27th, 2009
Hi Friends

I M Using vb6, i have a problem in this that when i execute my s/w so only, any single form becomes open at a time but i want that multiple forms must work together, Please Help Me.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 809
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: Related to Forms Property

 
0
  #2
Jun 27th, 2009
I think we are going to need a better explanation of what you want to do, because from reading your OP I can think of several things and some of them seem to be contrary to what you little sentance says...

So are you wanting to create a wizard like application in that the user goes from one form to the next filling out options?

Are you wanting several forms displayed at same time and when information changes on one it changes on the others?

Are you asking how to pass information from one form to another?
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 809
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: Related to Forms Property

 
0
  #3
Jun 29th, 2009
HI

Thank's to reply

accualy i want that several forms displayed at same time and when information changes on one it changes on the others,but in my application when a form is desplaying on dektop,& i m clicking on other form so that's not opening.
Above is quote from PM...

Okay, when displaying several forms (and this is just a quick example) you can do something like this (however this reuses the same form so is not directly related to what you want to do with different forms but as for a visual example it works)...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4. Dim F As Form
  5.  
  6. Set F = New Form1
  7. F.Left = 0
  8. F.Top = 0
  9. F.Width = Screen.Width / 2
  10. F.Height = Screen.Height / 2
  11. F.Show
  12.  
  13. Set F = New Form1
  14. F.Left = Screen.Width / 2
  15. F.Top = 0
  16. F.Width = Screen.Width / 2
  17. F.Height = Screen.Height / 2
  18. F.Show
  19.  
  20. Set F = New Form1
  21. F.Left = 0
  22. F.Top = Screen.Height / 2
  23. F.Width = Screen.Width / 2
  24. F.Height = Screen.Height / 2
  25. F.Show
  26.  
  27. Me.Left = Screen.Width / 2
  28. Me.Top = Screen.Height / 2
  29. Me.Width = Screen.Width / 2
  30. Me.Height = Screen.Height / 2
  31. End Sub
but if you have done something like this...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4. Dim F As Form
  5. Set F = New Form1
  6. F.Show vbModal, Me
  7. End Sub
then each form will display on top of one another and you will not be able to access any of the forms underneath until you close the top one.

Soooo, what does this mean you ask???? Well, when showing your multiple forms you probably want to do something like this...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Form2.Show
  3. End Sub
  4. Private Sub Command2_Click()
  5. Form3.Show
  6. End Sub
  7. Private Sub Command3_Click()
  8. Form4.Show
  9. End Sub

Now, if you want to have a form that stays behind others you can do this...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Form2.Show vbModeless, Me
  3. End Sub
  4. Private Sub Command2_Click()
  5. Form3.Show vbModeless, Me
  6. End Sub
  7. Private Sub Command3_Click()
  8. Form4.Show vbModeless, Me
  9. End Sub
This will keep forms 2, 3, and 4, on top of Form1 but you will still be able to interact with form1.


Okay, now for passing information from one form to another....

The most direct method is to pass information from whatever controls event in the form that has focus is to directly call any of the following in the other form...

Control like text box to utilize its change event
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Form1.Text1.Text = Form2.Command1.Caption
  3. End Sub
Or a public declared sub/function...
Public Function MyForm1PublicFunction(MyStringToPass As String) As String
'do stuff
End Function
[/code]
and it would be called like so...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. If MyForm1PublicFunction (Form2.Command1.Caption) = "OK" Then
  3. 'do stuff
  4. End If
  5. End Sub
And the last direct way would be to modify the display from the form that has focus by using the direct method above...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. '...
  2. Form1.Label1.Caption = "Some string"
  3. Form1.Text1.Caption = "Some string"
  4. '...


Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

Re: Related to Forms Property

 
0
  #4
Jul 3rd, 2009
Thank's For Reply, It Is Working Now
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC