Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to set image in textbox in wpf
- <TextBox Name="myTextBox" TextChanged="OnTextBoxTextChanged" Width="200">
- <TextBox.Background>
- <ImageBrush ImageSource="TextBoxBackground.gif" AlignmentX="Left" Stretch="None" />
- </TextBox.Background>
- </TextBox>
- // Create an ImageBrush.
- ImageBrush textImageBrush = new ImageBrush();
- textImageBrush.ImageSource = new BitmapImage(new Uri(@"TextBoxBackground.gif", UriKind.Relative));
- textImageBrush.AlignmentX = AlignmentX.Left;
- textImageBrush.Stretch = Stretch.None;
- // Use the brush to paint the button's background.
- myTextBox.Background = textImageBrush;
Add Comment
Please, Sign In to add comment