Affected : Form , Forms collection , MDIForm
Purpose : The Hide method makes an active and visible form disappear from the screen and is the same as setting the form's visible property to False ( 0 ) .
Syntax :
[ form . ] Hind
Private Sub Form1_Load ( )
Form2.Hide
Form2.BackColor = RGM ( 0 , 255 , 0 )
Form2.ForeColor = RGB ( 0 , 0 , 255 )
MsgBox " Press OK to see form2 "
Form2.Show
End Sub
The Hide method reduces clutter by removing a form from the screen without removing it from memory . Any forms not initially needed can be loaded and hidden until desired. The Show method displays a hidden form onscreen. Hidden forms take a little more time to load at program startup but can then be displayed very quickly.
Show Method :
The Hide method shares an inverse relationship with the Show method. Hide removes the form from sight and show restores it. In the sample syntax , the two methods work together to make a form invisible while its color change.This technique also can be used for a warning bialog box that displays context-sensitive messages. if the form is not loaded , the show method loads it into memory.
Visible Property :
When the Hide method makes a form invisible , the Visible property of the form becomes False. The difference between using the Hide method and directly changing the setting of the visible property lies in the types of objects affected . the hide method can only be used on a form .In contrast , the visible property can be used on any of the objects in visual basic.
Showing posts with label Method. Show all posts
Showing posts with label Method. Show all posts
Sunday, November 21, 2010
Visual Basic Forms Method : Hide
Saturday, November 20, 2010
Visual Basic Forms Method : Arrange
Purpose : Use the Arrange method on an MDI form to arrange all MDIchild forms contained within the MDI form.
Syntax :
[ Name ] . Arrange Setting%
Arguments of the Arrange Method
Arguments : Decsription
Name : Name property of the MDI form
setting% : A value that specifies how to arrange the windows or icons
Private Sub menuWindow_Click ( Index As Integer )
Select Case Index
Case 0 : MDIForm.Arrange vbCascade
Case 1 : MDIForm.Arrange vbTileHorizontal
Case 2 : MDIForm.Arrange vbTitleVertical
Case 3 : MDIForm.Arrange vbArrangeIcons
End Select
End Sub
Syntax :
[ Name ] . Arrange Setting%
Arguments of the Arrange Method
Arguments : Decsription
Name : Name property of the MDI form
setting% : A value that specifies how to arrange the windows or icons
Private Sub menuWindow_Click ( Index As Integer )
Select Case Index
Case 0 : MDIForm.Arrange vbCascade
Case 1 : MDIForm.Arrange vbTileHorizontal
Case 2 : MDIForm.Arrange vbTitleVertical
Case 3 : MDIForm.Arrange vbArrangeIcons
End Select
End Sub
Subscribe to:
Posts (Atom)