|
-
Nov 13th, 2007, 07:35 AM
#1
Thread Starter
Hyperactive Member
[2005] Odd things happen when resizing a custom control
I created a custom control consisting of two labels. When I resize the control, I want the second labels right edge to be aligned with the control's right edge.
However, when I put two of these controls on a form and resize one of them, the other one resizes also. And at a higher rate.
I have no idea why they are both resizing.
My code:
Code:
Private Sub DualBox_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
Me.tb.Width = Me.Width - Me.tb.Left
Me.Height = Me.l.Height
End Sub
l is the first label and tb is the second.
Any ideas?
Prefix has no suffix, but suffix has a prefix.
-
Nov 13th, 2007, 07:45 AM
#2
Hyperactive Member
Re: [2005] Odd things happen when resizing a custom control
Set tb to anchor left and right and position it where you want at design time....
And Im not sure how you want me.l to fit in with sizing the control, but from a WILD guess I would assume you might be using it to restrict the height of the control assuming me.l does not change height. if thats the case just use a set variable. otherwise maybe you could use the me.l's size changed event to set the controls height...
-
Nov 13th, 2007, 07:53 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] Odd things happen when resizing a custom control
Basically, when I resize one DualBox control the other DualBox control resizes as well. I do not know how to explain it very well. I could make a video of it. Thanks.
Prefix has no suffix, but suffix has a prefix.
-
Nov 13th, 2007, 07:58 AM
#4
Hyperactive Member
Re: [2005] Odd things happen when resizing a custom control
Sorry for the irrelevant post, should have read your post again.
That is strange, are you using any layout controls or are any of the events, variables or controls used in setting the size shared?
-
Nov 13th, 2007, 08:50 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] Odd things happen when resizing a custom control
I found out that both of the DualBox controls had their AutoSize property set to true. When I set even one of them to false then the problem stopped.
Prefix has no suffix, but suffix has a prefix.
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
|