WPF verification code, a small part of the original author's content, the original author of the wpf Verification Code
Address: http://www.cnblogs.com/tianguook/p/4142346.html
First of all, I would like to thank aparche for his post. because I may have to log on to the page in two days, I need to use the verification code to see this post from the great god. Thank you very much.
ValidCode
Public class Valid
WPF-create a non-rectangle window, And WPF-create a rectangle window
1. Set AllowsTransparency of the window to True.
2. Set the Background of the window to Transparent.
Third, set WindowStyle to None in the window.
4. Use Clip or Border to set the Grid in the window to the desired shape.
Code example (using Clip to implement the rounded corner window)
1
Code example (using Border to implement the rounde
The layout of WPF Program Development and the layout of wpf Program Development
UniformGrid: Special Grid. All cells are of the same size.
Canvas: similar to the canvas of html5, it can also be laid out based on coordinates like winform.
Grid: The table of the webpage
GridSplitter: The Separator in the Grid. You can drag it to adjust the size.
// ShowsPreview = "True" drag and drop will not be adjusted
WPF Learning Series games-select a picture to make a 9-cell puzzle and a wpf palace Tile
I want to learn about a puzzle project today.
The goal is to input an image, divide it into nine parts, remove one, and click the mouse to complete the puzzle.
The source file structure is simple.
Step 1: Create a project
There is nothing to say in this step. Creating a new project is the same as the source file struct
WPF bubble style pop-up window effect code sharing, wpf bubble style pop-up window
The page design requirement is as follows:
The design concept is as follows:
1. Use Path to draw the tip of the bubble and place it to the top layer;
2. Draw a rectangular box with border, place the box to the bottom layer, and set the Margin value so that the Path layer and border seem to be connected together.
The Code is
In WPF, the interface information is updated. In wpf, the interface information is updated.
1. Dispatcher. BeginInvoke
int ii = 0; new Thread(new ParameterizedThreadStart((i) => { while (true) { Thread.Sleep(400); Dispatcher.BeginInvoke(new Action(() => { ii += 1;
WPF learning path (5) Example: wordboard (continued), wpf Road
WordPad 2.0
In the previous issue, a Wordpad program with comprehensive functions was implemented, but the program code was slightly cumbersome. The Community version was updated in this issue.
MainWindows. xaml
Add the
Menu
Tool
TextBox
MainWindow. xmal. cs
public partial class MainWindow : Window{ private bool isDirty = false; pu
WPF learning path (14) style and template, wpf path style Template
Style
Instance:
If you do not set a style, you need to add duplicate code to each control, which is cumbersome.
You can set the TargetType of the Style. If you do not set x: Key, it will be applied to the conforming control by default. Note that Scope will take effect in the defined Scope.
Style has an Inheritance Mechanism
If you wan
WPF learning path (11) Layout (continued); wpf path
The layout is actually a Slot model. Each parent object is assigned a Slot to the sub-object. The sub-object can freely occupy space in the Slot and is controlled by Margin \ verticalignment \ HorizontalAlignment.
Instance
Note the differences between LayoutTransform and RenderTransform.
Custom Layout
Determining the optimal space size goes through
WPF custom message box, wpf custom message
Note:Create a simple message box that allows you to display images and buttons according to your needs.
Steps:
1. In fact, the message box is a Window. First, set the display position and display size of the form to make it look like there is a message box. The Code is as follows:
Height="206" Width="420" WindowStartupLocation="CenterScreen" BorderThickness="1,0,1,
The message box with masks is displayed in WPF, And the masks are displayed in wpf.
Ideas
Get the content of the parent form, put it in a container, and then put a translucent layer in the container. Assign the entire container to the content of the parent form.
Reverse operation when disabled.
Code
When the message window pops up
1 ///
When the message box is closed
1 ///
Source code download: Message
Submission and revocation of WPF data editing, and revocation of wpf editing
When you add or edit an item to a set (usually bound to a DataGrid or other ItemsControl controls), an attribute of the edit item is usually displayed on the editing page. After editing, the item is submitted, or we don't want to edit the data. At this time, we select cancel. The content of the data item has not changed.
When you
WPF multi-source binding and WPF source binding
The control is bound to multiple data sources, and ListBox is bound to a collection. each item is bound to two attributes of the object in the collection, and the binding is formatted.
Custom value conversion for multi-source binding. The TextBlock control is bound to one of the NameListData sets. When an object in the set is selected, the two attributes of
WPF scroll subtitles and WPF scroll subtitles
XAML code:Background code:Using SunCreate. combatPlatform. domain; using System. collections. generic; using System. linq; using System. text; using System. threading; using System. timers; using System. windows; using System. windows. controls; using System. windows. data; using System. windows. documents; using System. windows. input; using System. windows. me
Simple implementation of WPF bubble prompt box and wpf bubble implementation
I dug a big hole myself, and then I was forced to rewrite the code style! Not much waste
Directly Add code
1
Create a TextBox at the front end, and add the following attributes to the additional attributes:
1
:
Style code:
1
Original Source: http://www.cnblogs.com/PettyHandSome/
You are welcome to repost the article, but w
[WPF series] advanced debugging and wpf series debugging'Provide value on 'System. Windows. baml2006.typeconvertermarkupextension' threw an exception. 'line number '49' and Line position '38' in ImageBrush'
Assuming the image is:
Added in your project
It's in a folder named "Images"
The build action for the image is set to "Resource" (shocould be the default)
You can reference it like this:
Chuanzhi podcast -- WPF basic video learning -- sender explanation, -- wpf -- sender
Sender is the object that fires the event. If it is used in the double-click event of the Button, it is only the currently clicked object.
For example, there are two Button controls: 1 and 2, respectively, and a Button_Click event is bound.
Private void Button_Click (object sender, RoutedEventArgs e) {Button btn = (Button)
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.