PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
SideForm / SideMenu / SideBar Example-VBForums
Results 1 to 2 of 2

Thread: SideForm / SideMenu / SideBar Example

  1. #1

    Thread Starter
    "The" RedHeadedLefty
    Join Date
    Aug 2005
    College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation

    SideForm / SideMenu / SideBar Example

    Here is a small quick example of how you can incorporate a side bar / side form / side menu to your application. All this does is show a borderless form at the location of the label when you hover your mouse over it. Sample project as well as a picture of it "in action" is at the end.

    There really isn't much to the code... in Form1 there is one label on the right side of the form, and the code in it:
    VB Code:
    1. 'class level, in form1
    2. Private Form2 As New Form2 'the menu form
    4. 'displays form on mouse enter
    5. Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter
    6.         Form2.Show()
    7.         'gets location of label in screen coordinates, so we can set the position appropriately...
    8.         Form2.Location = Me.PointToScreen(New Point(Me.Label1.Location.X + Label1.Width, Me.Label1.Location.Y))
    9.        'I found that putting the .Location before the .Show method sometimes
    10.        'resulted in a weird starting location for the side form
    11. End Sub
    Form2 is just a borderless form, with a button created on it, with a simple Me.Hide() command in order to hide the form when clicked.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by gigemboy; Feb 13th, 2006 at 07:31 AM.

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Searching for mendhak

    Re: SideForm / SideMenu / SideBar Example

    In accordance with this CodeBank policy, the SideForm attachment has been edited and the .Exe exectuables have been removed.
    Last edited by Hack; Feb 13th, 2006 at 07:37 AM.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width