Is it possible to set image as background to textbox

Usha Patil 31 Reputation points

Is it possible to set image as background to textbox

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,699 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Rajanikant Hawaldar 91 Reputation points

    Yes its possible check below,

        <ImageBrush ImageSource="Rose.jpg" />  
    0 comments No comments

  2. DaisyTian-1203 11,616 Reputation points

    You can also set the image in the cs code:

            ImageBrush textImageBrush = new ImageBrush();  
            textImageBrush.ImageSource = new BitmapImage(new Uri(@"...\1.jpg", UriKind.RelativeOrAbsolute));  
            textImageBrush.AlignmentX = AlignmentX.Left;  
            textImageBrush.Stretch = Stretch.None;  
            myTextBox.Background = textImageBrush;  

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments