Setting a Silverlight textbox control's width relatively

Posted by John K. on Stack Overflow See other posts from Stack Overflow or by John K.
Published on 2010-03-31T01:59:26Z Indexed on 2010/03/31 2:03 UTC
Read the original article Hit count: 388

Filed under:
|
|
|
|

Hello,

I tried searching on stackoverflow for an answer to my question but couldn't seem to find anything relevant.

Since I'm relatively new to Silverlight, I'm not even sure if this is possible, but I am trying to figure out if it is possible to set a Silverlight textbox control's width value proportionally to it's immediate parent container?

It would be nice to avoid hard coding a width value. Say you want to place a textbox control inside a horizontally aligned StackPanel control and have it's width always dynamically adjusted to be 80% of the total width of the StackPanel.

Is this possible to do declaratively in your xaml markup, or will I need to resort to some codebehind attached to some event handler to accomplish this?

fyi, I am currently using Visual Web Developer Express 2008 to write my silverlight code.

thanks in advance, John

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about xaml