Hey guys,
It seems to me that the Ribbon control has a problem with textboxes. I was expecting a common TextBox control behaviour: a fixed width and a visible caret when the text exceeds the width. But the RibbonTextBox control changes its width and when the text exceeds the right limit, the overflow is not visible.
I found a hack on a blog that does something like this:
var img = SearchButton.Template.FindName("image", SearchButton);
if (img != null && img is Image)
(img as Image).Visibility = Visibility.Collapsed;
var lbl = FindTemplateControl<Label>(SearchText);
var border = SearchText.Template.FindName("Bd", SearchText);
if (border != null && border is Border && img != null && lbl != null)
{
(border as Border).Width = SearchText.ActualWidth - (((Image)img).ActualWidth + lbl.ActualWidth);
}
but I reallly don't want to do such a workaround. Is there any other simpler way to achieve simple TextBox behaviour?