Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a main form send data to subforms
DescriptionThis example shows how to make a main form send data to subforms in Visual Basic 6.
KeywordsForm, subform, secondary form, data
CategoriesControls
 
The program's main form displays the secondary forms. Each secondary form has a public SendData method that the main form uses to send it data.
 
Private Sub Form_Load()
    ' Position this form.
    Move 300, 300

    ' Display the forms.
    Form2.Move Left + Width + 300, Top, Form2.Width, Height
    Form2.Show

    Form3.Move Left, Top + Height + 300, Width
    Form3.Show

    Form4.Move Left + Width + 300, Top + Height + 300, _
        Width, Height
    Form4.Show
End Sub

Private Sub Timer2_Timer()
Static value As Integer

    value = value + 1
    Form2.SendData value
End Sub

Private Sub Timer3_Timer()
    Form3.SendData Time
End Sub

Private Sub Timer4_Timer()
    Form4.SendData Rnd * 2000000000
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated