I'd like to make a textbox with a button inside, something like a date picker, but not exactly. Or it can be a combobox inside the textbox, so you can switch the text box "mode".
Can you help me?
I'd like to make a textbox with a button inside, something like a date picker, but not exactly. Or it can be a combobox inside the textbox, so you can switch the text box "mode".
Can you help me?
You can use RichTextBox instead of textbox and it support flowdocument in which you can place the button in it.
If you want something like a combobox or a date time picker you should create a new control, inside this new control place a text box and a button side by side inside a frame that looks like the frame of a textbox - then restyle the textbox so it doesn't have a frame.
putting a button inside a rich edit is great if you want to put a button inside a "document" but not a good substitute for a combobox.
See the ComboBox control template at http://msdn.microsoft.com/en-us/library/ms752094.aspx
I created a textbox control and added this It seems to work, but not the ideal situation cos it recreates another textbox.
<TextBox.Template>
<ControlTemplate>
<Grid>
<Grid.ColumnDefinitions></Grid.ColumnDefinitions>
<TextBox Grid.Column="0"></TextBox>
<Button HorizontalAlignment="Right" Width="25" Grid.Column="1">
</Button>
</Grid>
</ControlTemplate>
</TextBox.Template>