Results 1 to 5 of 5

Thread: Form Size and Location Questions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Form Size and Location Questions

    I have a form that I wish to be:
    1. borderless
    2. draggble
    3. have windows remember its last postion (ie if you open IE and drag it somewhere, next time you start IE it will remember the position it was last in).
    4. right clickable


    I set formborder to none

    I set startposition to WindowsDefaultBounds (based on MSDN this remembers default windows location and size - I think that is what I want)

    I cant drag the window?

    Right clicking on the form or the taskbar does nothing. If I click the context menu property dropdown the only choice is none?

    Any help appreciated.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Re: Form Size and Location Questions

    My workaround is to have a button that changes that toggles the formborderstyle between none and sizable.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Form Size and Location Questions

    You have no choices from the context menu since you removed the titlebar by setting the form to borderless. What you would have to do is detect the forms click action and sinulate the click is on the titlebar so it will be draggable.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Re: Form Size and Location Questions

    Quote Originally Posted by RobDog888
    You have no choices from the context menu since you removed the titlebar by setting the form to borderless. What you would have to do is detect the forms click action and sinulate the click is on the titlebar so it will be draggable.
    I still can't it to remember position each time I start? Do I have to use Application Settings for that?

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Form Size and Location Questions

    Use the Formss StartupPostiion of Maunal and then set the .Location in code from your Settings. Save the settings again upon FormClising event.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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