+ Reply to Thread
Results 1 to 2 of 2

Remove borders and x sign on a userform through VBA

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Reston, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Remove borders and x sign on a userform through VBA

    Hello,

    I need to remove borders on the userform in excel including the title bar and close sign. I used the code that I found on this forum. http://www.excelforum.com/excel-prog...m-borders.html
    It seems to work but now my userform has a white line on the bottom. I am not sure if its part of the border or its because the code is not complete. Any advice is greatly appreciated.
    I am using excel2010.

    Pic of the userform is attached. User form.jpg

  2. #2
    Registered User
    Join Date
    10-21-2014
    Location
    Georgia, United States
    MS-Off Ver
    2007
    Posts
    5

    Lightbulb Re: Remove borders and x sign on a userform through VBA

    Although this is a very old question, I was searching for the same answer so followed Sahonero's question and provide my fix for anyone else with the same problem.

    Although it's a not very elegant, at least it's a fix - for now until someone more enlightened comes along.

    In the UserForm code provided by Leith Ross, add two lines, one before and one after the call to the API routine "(RemoveFrame)":
    • Set the user form height to 0. (This makes the removal of the Windows Title Bar and Borders occur on a zero height object.)
    • After the call, set the height as desired. (This expands the unframed user form to its correct height.)

    My example sets it at a fixed height (determined by trial and error based on the heights of the controls on the form). You can code it to match the content of the user form by adding lines before the last to calculate based on the heights of the controls. The same applies to width obviously

    UserForm Code
    Please Login or Register  to view this content.
    I'd be more than happy for someone to provide the elegant solution!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1