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 an expandable dialog with More and Less buttons
Keywordsdialog, more, less, expandable, detail
CategoriesSoftware Engineering, Controls
 
When the user clicks the More or Less button, resize the form accordingly. For convenience, use Line controls to mark the dialog's small and large sizes.
 
Private Sub cmdMoreOrLess_Click()
    If cmdMoreOrLess.Caption = "More" Then
        Height = Line2.Y1 + Height - ScaleHeight
        cmdMoreOrLess.Caption = "Less"
    Else
        Height = Line1.Y1 + Height - ScaleHeight
        cmdMoreOrLess.Caption = "More"
    End If
End Sub

Private Sub Form_Load()
    cmdMoreOrLess.Caption = "Less"
    cmdMoreOrLess_Click
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated