|
-
Oct 11th, 2005, 11:39 AM
#1
Thread Starter
Member
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!
-
Oct 11th, 2005, 11:53 AM
#2
Thread Starter
Member
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.
-
Oct 11th, 2005, 11:53 AM
#3
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.
-
Oct 11th, 2005, 11:55 AM
#4
Fanatic Member
Re: Resize object by Resize
 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:
label1.Height = Form1.Height - 1800
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
-
Oct 11th, 2005, 11:55 AM
#5
Re: Resize object by Resize
Do you want the label to completely fill the available client space of the form?
VB Code:
Private Sub Form_Resize()
If WindowState <> vbMinimized Then
If Me.ScaleHeight > 1800 Then label1.Height = Me.ScaleHeight - 1800
If Me.ScaleWidth > 500 Then label1.Width = Me.ScaleWidth - 500
End If
End Sub
-
Oct 11th, 2005, 11:56 AM
#6
Thread Starter
Member
Re: Resize object by Resize
Thanks all, Problem solved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|