Results 1 to 6 of 6

Thread: Resize object by Resize (RESOLVED)

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Resolved Resize object by Resize (RESOLVED)

    I am trying to resize an object, lets use a label as an example:
    Private Sub Form_Resize()
    label1.Height = Screen.Height - 1800
    label1.Width = Screen.Width - 500
    End Sub
    Using this code will only resize to the size of the window, whereas I need the object to resize to the form.
    Any help is greatly appreciated, Thanks in advance if I don't get back to you.






    Added green "resolved" checkmark - Hack
    Last edited by Hack; Oct 11th, 2005 at 12:18 PM.
    HaLA oWNS J00!

  2. #2

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Re: Resize object by Resize

    To Help you understand my posistion, I will further explain my problem:
    Private Sub Form_Resize()
    label1.Height = Screen.Height - 1800
    label1.Width = Screen.Width - 500
    End Sub
    -
    Where screen.height is, I need to replace screen with the current value of the form height.
    HaLA oWNS J00!

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Resize object by Resize

    You want the label to cover the entire form, or stretch to its left and right edges, or stretch to its top and bottom edges, or.....?

    By the way, in terms of your application, your form is the window.

  4. #4
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: Resize object by Resize

    Quote Originally Posted by Halazonia
    To Help you understand my posistion, I will further explain my problem:
    Private Sub Form_Resize()
    label1.Height = Screen.Height - 1800
    label1.Width = Screen.Width - 500
    End Sub
    -
    Where screen.height is, I need to replace screen with the current value of the form height.
    couldn't you just do?

    VB Code:
    1. label1.Height = Form1.Height - 1800
    2. label1.Width = Form1.Width - 500
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Resize object by Resize

    Do you want the label to completely fill the available client space of the form?

    VB Code:
    1. Private Sub Form_Resize()
    2.    If WindowState <> vbMinimized Then
    3.  
    4.        If Me.ScaleHeight > 1800 Then  label1.Height = Me.ScaleHeight - 1800
    5.        If Me.ScaleWidth > 500 Then  label1.Width = Me.ScaleWidth - 500
    6.      
    7.    End If
    8. End Sub

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Paris Onatrio, Canada
    Posts
    44

    Re: Resize object by Resize

    Thanks all, Problem solved.
    HaLA oWNS J00!

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