Geeks With Blogs

News
Geekus Con Livus Malcolm Anderson's home for Geeks With Lives

We've got a custom control that consists of 2 radio buttons, a "normal button", and a text box, all on a single line.
Internal to the control, I have all 4 of member controls lined up so that all the text is on one line.
So far, so good.  Except for one thing.
When I put my control on my form, I can not get the text on my form to line up with the text on my label, and I end up manually futzing it into something that resembles "it's place".  Where are my alignment functions?

I guess it's off to google.

My first google search was
 forms align text .net

This didn't get me anything useful, but I did get some stuff from asp.net.

Let's try requiring both "forms" and "align"
 +forms +align text .net

That didn't help either, people with questions, but no answers

Next I tried
 how do I align my textbox with my custom control

And got an interesting hit down at #6
"SnapLines not honored during resize." and the body says
"I have a custom control that contains a textbox. It has two ... the name string (based on the MeasureString length) and my Right snap ... "
let's go look at it.


http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic62981.aspx
well, would you look at that ... snaplines, is that a new keyword?  I go and check out the post.
ravi.s.desai@gmail.com seems to be having the same problem I am, I have a custom control that is just a collection of windows controls, but I can't align them.
As he puts it,
"Actually, to simplify the above, it appears that when you are resizing
a control, all snaplines  defined in the designer are completely
ignored, and the designer simply creates a snap-line for the edge of
the control that you are dragging, and uses that exclusively.  Is this
by design?  It certainly seems to limit the value of snaplines for
layout."

At this point, I stop, and write up the progress of my research up to this point.

Hopefully, the new keyword (snaplines)
a) actually is a keyword
b) produces fruit

Into google goes the phrase
snaplines custom control

The first choice is
"Using SnapLines from child controls of custom user control? - MSDN ..."

Which seems to indicate that while what I want to do, *can* be done, it's not simple, easy, or intuitive.

Now I have to ask the question, is this worth my time.

Answer, not in the short run, but definitely in the long run.

 

I'll be back...

Posted on Thursday, June 14, 2007 11:23 AM Contracting , Stupid Code Tricks | Back to top


Comments on this post: Alex, I'll take "Google Key Words" for 1000

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Malcolm Anderson | Powered by: GeeksWithBlogs.net