crazy UserControl

  • Thread starter Thread starter Galen Somerville
  • Start date Start date
G

Galen Somerville

I have a user control with a Panel and five Labels. The end result is a
circular volume control (no actual circle is shown). The Size is 90,97

I fire up VB2005, Select Windows Application, add a couple of buttons and my
user control. The buttons are just to run the code that sets the volume to a
preset value.

The control displayed is the correct size (90,97). Everything works as
expected. I can even grab the volume pointer and drag to some other setting.

Now I load up my application and go to the proper form. I place the user
control, from the toolbox, onto my form. The size becomes 105, 119 (not the
expected 90,97). I cannot change the size !! Notice that the aspect ratios
are not the same.

I've tried setting it to Autosize=True and GrowandShrink. Nothing helps.

Where oh where did I go wrong?

GalenS
 
Hi Galen,

The default constructor of your control has the clue. Make sure you are
putting in the right values in there.

Hope this helps.
 
As a guess (I can't see any code for your control), try overriding the
DefaultSize property to return a size of (90, 97)
 
I set up this Circular Volume control using the procedures in Help. I
believe it was setting up a Clock user control. That Clock control and the
way my control operates is purely coincidental.

I have put the user control on my web site and I would appreciate someone
looking at it to see why it doesn't resize correctly.

http://home.surewest.net/galen/index.html under Downloads.

The control would typically be setup using the following:
CircVol1.Name = "A"
CircVol1.BackColor = Me.BackColor
CircVol1.VolVal = 128

Clicking any label sets the volume to that position.
Clicking anywhere in the Panel (Orange color) sets the volume to that
position because of Mouse events.
Dragging anywhere in Panel moves the volume accordingly.

Thanks

GalenS

"Radhakrishna Banavalikar"
 
Yuan Ren

Did you get my direct Email on this subject?

For some reason I couldn't make a reply via the newsgroup.

GalenS
 
Hi Galen,

Thanks for your reply!

My alias is (e-mail address removed) (remove .online).

Thanks,

Yuan Ren [MSFT]
Microsoft Online Support
 
Back
Top