Because the project belongs to the completed project, the process experiment report is submitted, here one-time submitted to the blog to share
Create a new WPF project named Httpserver
Click MainWindow.xaml to enter the designer environment for XAML
In the designer environment, we can modify the interface through the XAML code editor below.
You can also adjust the position by dragging the control from the right toolbox
According to the experiment, we should drag and drop two text boxes.
Then we need to add two more lines of text box
We need to edit the Wrap property of the text box when we are done with the drag.
We can modify the XAML directly or modify it in the right control property
Enter related modifiable properties in the search box above the property box to quickly find the modifications
The textwrapping attribute in the figure can be modified, wrap represents a newline, and nowrap is not wrapped.
Some other types of properties can be modified as required, adding properties such as Enter line wrapping
In addition to drag-and-check editing via the graphical interface, we can also write XAML code directly
In a format similar to XML, we can add a delete property to a row to modify the TextBox's properties, and the default value is the one that does not exist.
For example, we can add the textwrapping= "wrap" directly, and the wrap value can be modified.
Understanding the interface editing methods of XAML in WPF, we can continue to complete the experiment, write all the controls and adjust the position.
Fix the control's assignment and start modifying the default display of the control, such as modifying the title, label, and default text display of the textbox
The design of the initial finish interface after the modification is completed
The next step begins to process the corresponding
In the properties can be switched to the event corresponding to the processing function filling interface
Where we need to add a click to the button control corresponding
Enter to access the Background code processing interface
This function is triggered whenever a button is clicked
After the interface and response logic are processed, the specific implementation of the corresponding function can be processed
Request to copy input box contents to output box
Also, we need to get the resource name variable name of the input and output box to control
Add two x x:name
Then add a row of recv. Text = send. Text for replication
Then you can run the program to test
Enter text on the left, click Send, the same content appears on the right, run successfully
Multiple input tests, can be run correctly
I have used WPF development-related programs before the experiment, so the process is not experiencing any problems, consolidating the basics and operations, providing the foundation for the next experiment, and configuring the relevant operating environment
C#-judgesystem System-Install and familiarize yourself with the C # development environment