Msdn Teaching Short Film WPF 7 (WPF text box)

Source: Internet
Author: User
WPF text box

In fact, we went on to talk about the last lesson.

Drag a textbox to the form, and draw a picture on the background color of the word.

<Textbox margin = "0, 52, 16, 69" name = "textbox1" fontsize = "36"
Background = "yellow" borderbrush = "red" borderthickness = "7"
Fontfamily = "Arial bold">
<Textbox. Foreground>
<Imagebrush imagesource = "rose.bmp"/>
</Textbox. Foreground>

</Textbox>

For better results, we set the font to Arial bold.

Because of the image, the effect is not very good.

Next we will give it two text boxes for reflection.

The square above.

  <Rectangle margin =" 5, 7, 16, 0 "Name =" Rectangle1 "Stroke =" Black "Height =" 42 "Verticalalignment =" Top "Strokethickness =" 0.01 "> <Rectangle. Fill> <visualbrush visual =" {Binding elementname = textbox1} "> <Visualbrush. relativetransform> <transformgroup> <scaletransform scalex =" 1 "Scaley =" -1 "/> <Translatetransform y =" 1 "/> </Transformgroup> </visualbrush. relativetransform> </visualbrush> </rectangle. Fill> </rectangle>

The following square.

  <Rectangle margin =" 5, 0, 16, 25 "Name =" Rectangle2 "Stroke =" Black "Strokethickness =" 0.1 "Height =" 41 "Verticalalignment =" Bottom "> <Rectangle. Fill> <visualbrush visual =" {Binding elementname = textbox1} "> <Visualbrush. relativetransform> <transformgroup> <scaletransform scalex =" 1 "Scaley =" -1 "/> <Translatetransform y =" 1 "/> </Transformgroup> </visualbrush. relativetransform> </visualbrush> </rectangle. Fill> </rectangle>

HereCodeThis is what we talked about in the previous lesson.

You can see the effect through implicit conventions.

If we put the three in a grid, it is equivalent to encapsulating the three squares.

<Rectangle horizontalalignment ="Right"Margin ="0, 26, 0, 39"Name ="Rectangle3"Stroke ="Black"Width ="184"> <Rectangle. Fill> <visualbrush visual ="{Binding elementname = grid1}"/> </Rectangle. Fill> </rectangle>

Here we bind it to the grid with three original squares.

The one on the right is a bound giant block.

End.



 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.