Results 1 to 4 of 4
  1. #1
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61

    Is it possible to Programmatically resize label box inside a Form?

    Hello I would like to use a label like a message box.


    The label size would have to resize itself up the changing messages.

    Is this possible?

    If it is possible can you provide a sample code?


    Thanks a bunch

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can set its Height and Width properties (which are in twips):

    Me.Label33.Width = 2000
    Me.Label33.Height = 1000
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Further to Paul's comment, I did a small test which was successful

    Code:
    Private Sub Command2_Click()
    On Error GoTo Err_Command2_Click
    Dim origsize As Integer
    origsize = Me.Label1.Width
    Me.Label1.Width = origsize * 2
    Me.Refresh
       
    Exit_Command2_Click:
        Exit Sub
    
    Err_Command2_Click:
        MsgBox Err.Description
        Resume Exit_Command2_Click
        
    End Sub

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Something screwed up during posting. I was trying to edit previous post and add jpgs to show the effects of the code.
    Attached Thumbnails Attached Thumbnails LabelResizeStart.jpg   LabelResizeFinal.jpg  

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 12-09-2014, 09:24 AM
  2. Replies: 4
    Last Post: 09-16-2014, 03:32 PM
  3. Replies: 1
    Last Post: 04-25-2014, 11:41 AM
  4. Replies: 1
    Last Post: 04-29-2010, 05:15 PM
  5. Resize Switchboard form
    By smikkelsen in forum Forms
    Replies: 3
    Last Post: 04-03-2010, 06:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums