+ Reply to Thread
Results 1 to 16 of 16

UserForm's Width

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    UserForm's Width

    Is there any way, without faking it, to actually do this:
    Please Login or Register  to view this content.
    Problem: UserForm's Width's Minimum Value.

    My project: I have a borderless UserForm and I need the width of it to be set to 75,75.
    (I don't wanna make it half transparent or any of that)

    Thanks in advance!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: UserForm's Width

    This seems to be a hard limit. Why do you want such a narrow width? Maybe we can come up with another way to solve your overall problem.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    I'm trying to resize the width because of this black space:

    L4keJKY.png

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm's Width

    There is a minimum width - somewhere about 102 whateveritis's used to define the width. You cannot get around that even if you set the border sizable.

  5. #5
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    I already know about that. What I'm asking is if there's any possible way to somehow change the width even with that minimum value, I don't know, APIs seems to solve everything if you know what to call...

  6. #6
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    I guess I will just make it 2x bigger but I really don't like the limitations... I know it's Excel 2007 but it's what I have to use here.
    At home is the most recent Visual Studio

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: UserForm's Width

    You can't do it, but you can fake it: http://stackoverflow.com/questions/2...ess-than-29-25

  8. #8
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm's Width

    You can do a lot with APIs - make the border sizable, remove the caption, make a small 'tooltip' caption bar, prevent the userform from being moved on screen, set the min and max allowable sizes (without that annoying flicker you get if the size is set in the Resize event) - but you cannot make it any narrower than 102 if the title bar is visible, but you can get that down to 12 (Ahem - See post #11) without a title bar ...

    I realise that contradicts what I said earlier - just keeping it simple.
    Last edited by cytop; 05-10-2016 at 07:21 AM.

  9. #9
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    Quote Originally Posted by cytop View Post
    you can get that down to 12 without a title bar ...
    How? Isn't removing the borders, removing automaticaly the title bar?

  10. #10
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    Well, I do have a module that makes the form transparent and the controls visible but it takes some time to load (depending of the form's size) ...

  11. #11
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm's Width

    No. Removing the title bar is yet another API call.

    Short video showing a userform with the various attributes selectable. Making it Resizable and removing the Caption (Title) bar allows the form to be made very small, min 6 height & width, but that's a bugger to make bigger!): https://tinytke99-mailinator.tinytak...jAyXzMxNTEyMTE

    New versions of Excel have played around with the GDI (Graphics Device Interface). That sample shows a very thin caption bar. This was not evident on Excel 2007 systems (Video of userform in XL2007 running in a Virtual machine: https://tinytke99-mailinator.tinytak...zM3XzMxNTE1MzE)

    I'm working on getting rid of that on newer versions...
    Last edited by cytop; 05-10-2016 at 07:16 AM. Reason: typo

  12. #12
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    Quote Originally Posted by cytop View Post
    I'm working on getting rid of that on newer versions...
    You look like a developer .
    Are you ?

  13. #13
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm's Width

    Sometimes. I develop turnkey systems in Excel - the speciality is making it NOT look like Excel

  14. #14
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    Can I ask a thing. Don't get me wrong but why does so much people still uses this?
    I can't find anything better than visual basic/visual studio rather then:
    It has excel/workbook (the cells and all of that) and it may be faster (IDK).
    I only use on work. I think the overall of the VBA is weaker than VB.
    Don't hate me...

  15. #15
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm's Width

    I think the overall of the VBA is weaker than VB
    True. VBA is a subset of Classic Visual Basic 6 (Although I think it was actually VB5 that was the source). Just about any other language is faster, even classic visual Basic.

    It is widely used because it is simple to pick up and is tightly integrated with Excel/Word and other Office applications. Users with a little bit of common sense and a knack for Google can end up writing complex systems which, over time, become the king pin for the office, if not the entire division, or even company. Fred, who wrote the system, then falls under a bus or gets a job with a competitor (or simply retires to a desert island 'cos his system enabled him to embezzle his Drop-dead money) and suddenly the whole place is in a panic - lots of that type of work around .

    The other common work pick-up is a place that decides to try and do it themselves, get's 70% of the way through it but then find they don't have the skills necessary to complete. The choice then is live with what they have (usually not an option), throw it away and write off the investment, or get someone in to finish it off.

    It's a lot more daunting to develop Excel add-ins or templates using Visual Studio, which is the next easiest way to integrate things with Office Apps, but the learning curve is a lot steeper and a lot longer - and that equals more expense (in the short term, at least).

    Don't hate you, I used Classic Visual Basic right from version 1 to Version 6 & NET - I can't stand NET so 'dropped down' to VBA to stay with something as close to VB6 as still eixsts.
    Last edited by cytop; 05-10-2016 at 09:12 AM.

  16. #16
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: UserForm's Width

    I once saw a dinassaur meme saying something like:
    If you need a program to program a program, than how do you program a program to program a program?
    I love that.
    It means something like, if you need VB to code your program, than how do you code a program to code VB (...to code your program)?
    And now that can be looped.
    If you need a program to program a program to program a program, than how do you program a program to program a program to program a program?
    That means, if you need VB to code VBA to code your program, than how do you code a program to code VB (...to code VBA to code your program)?

    The worst is that with that philosofy you get nowhere because the programs are not public or there's really low information about them...
    The companies just create them for them selfs and then program stuff for us, the clients. It's hard to learn about 'programming directly on the BIOS?' or using some language like C but what compiler you ask, well, the compiler is written in C to, wtf?

    The End
    Last edited by rdrmdr; 05-10-2016 at 09:32 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Let dropdown list width expand beyond width of column so people can read answer choices?
    By xdrenched in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-15-2023, 02:05 AM
  2. Dynamic UserForm as Message Box with selectable width
    By Warbe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2016, 10:48 AM
  3. Reconciling units: Column width and image width
    By MarmaladeLover in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2015, 03:03 PM
  4. Replies: 2
    Last Post: 07-30-2014, 11:13 AM
  5. [SOLVED] Seting the dropdown column width in UserForm ComboBox
    By Andre_D in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-16-2013, 08:22 PM
  6. Adjust Text Box Width on Userform
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2008, 07:40 PM
  7. UserForm TextBox with fixed Width and dynamic Height
    By Soniya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2006, 04:45 AM

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