: BinaryWriter
// Instantiate a save file dialog box
SaveFileDialog sf =NewSaveFileDialog ();
// Set the file storage type
Sf. Filter = "txt file | *. txt | all files | *.*";
// If the user does not enter the extension, the suffix is automatically appended.
Sf. AddExtension =True;
// Set the title
Sf. Title = "Writing Files ";
// If the user clicks the Save button
If(Sf. ShowDialog () = DialogResult. OK)
{
// Instantiate a file stream ---> associated with the written file
FileStrea
= "";} //************************************** * ********************************** // multi-format text box textChanged Event code //********************************** **************************** * ********** Private void richtextbox=textchanged (object sender, EventArgs e) {// after the text box is modified, set s to false, the file is not saved. s = false ;} //************************************** * ********************************** // [file]
RichTextBox Control (that is, the synchronization context of the previous method), and then let the Invoke callback method run on this thread ):
btnClick_Click(= = = caller.BeginInvoke(GetResult, ( i = ; i
The running result is:
The above section demonstrates how to use the traditional asynchronous programming model (APM) to solve the problems of Synchronous Code. NET 2.0 ,. NET 4.0 and. in NET 4.5, Microsoft has
Play C # speech recognition,
In. NET4.0, I can use the System. Speech component to let the computer recognize our voice.
Above, when I say "name", show "Darren", I say "age", show "Forever 21 ". What should we do?
First, enable the computer's speech recognition function.
Right-click the speaker at the bottom right of the computer and select "Recording Device ".
Click the default "Microphone", and then click "Configure" in the lower left corner.
Click "Start Speech Recognition ".
different browser interpretations of Javascript, often working overtime and staying up late for these problems, and we don't have to worry about trying to solve these headaches. With Silverlight technology:
We can overcome the incompatibility and inconsistency of existing technical platforms.
We have the ability to create a consistent user experience on multiple platforms and various browsers. No matter where it is, the application is consistent in appearance and behavior.
We can use the cl
....... Characteristics of the classA3 ....... Access level of the classA4 ....... Definition of ClassA5 ....... Interface (Interface)A6 ....... Data membersA7 ....... Methods (method)A8 ....... Attribute (property)A9 ....... Fields (field)Aa............ Constructors and destructorsAb............ IndexerAc ....... Abstract classes and abstract functionsAd ....... Sealing class and sealing functionAe............ OtherAf............ Some tricksCollection:A1 ....... CollectionBase classA2 .......
1, the Realization form full screen display
Method: Do the following in a Full-screen method
This. FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
This. WindowState = System.Windows.Forms.FormWindowState.Maximized;
2. Realize the full screen display of a control in the window body
Method: For example, to display the RichTextBox control in full screen, as follows (this is the current form)
This. FormBorderStyle = System.Windows.For
in the desktop tray.
(1), New project--> select Visual C # project--> Enter the project name: Inputlanguagerichedit.
(2), in the Toolbox, drag a RichTextBox control, named: RichTextBox1; a combobox control named: ComboBox1; a button control named: But_exit.
(3) Replace the private void InitializeComponent () with the following code.
{ This.combobox1 = new System.Windows.Forms.ComboBox (); This.richtextbox1 = new System.Windows.Forms.RichTextBo
purpose. Technology is not difficult, mainly reflects C # network programming and registry modification.
Control-side development:
The control end sends a control code to the server, the service end (Trojan program) receives the control code, according to the control request, completes the specified request, if the server completes the work, returns the successful information.
Development of the control side:
Control code settings you can set yourself, do not need to be detailed, there are the
the current system with a list box, and automatically change the input method of the current thread by changing the option of the list box. It also implements the option of changing the list box according to the changes in the input method in the desktop tray.
(1), New project--> select Visual C # project--> Enter the project name: Inputlanguagerichedit.
(2), in the Toolbox, drag a RichTextBox control, named: RichTextBox1; a combobox control named:
"face-changing" capability, they can be used on many occasions to gracefully address some previously intractable problems (usually, we used reflection to solve the problem), such as:
(1) "Generic parameter types are dynamic", using dynamic proxies to solve this problem can not only avoid the performance loss caused by reflection, but also gain the benefit of strongly typed method invocation.
(2) "Face" for a group of types. For example, Windows controls such as TextBox,
();
Four, shielding Ctrl-vThe TextBox control in WinForm has no way to mask the ctrl-v clipboard paste action, if you need an input box, but you do not want the user to paste the contents of the Clipboard, you can use the RichTextBox control instead, and the CTRL-V key is masked in KeyDown, example:
private void Richtextbox1_keydown (object sender, System.Windows.Forms.KeyEventArgs e){if (E.control e.keycode==keys.v)E.handled = true;}
V. Determine w
, returns the successful information.
Development of the control side:
Control code settings you can set yourself, do not need to be detailed, there are the following key problems.
1. Connection request
was used. Net class, the System.Net.Sockets.TcpClient class in theTcpClient (string Hostname,int port)Hostname is the host name to be controlled, of course you can also use IP address.Port is ports.System.EventArgs the base class that contains the event data classprivate void Button7_click (objec
Introduced
Silverlight 4.0 Control Overview:
* Viewbox-a container control in which there can be only one child element. Viewbox can determine how the child elements inside are stretched, scaled, aligned
* RichTextBox-Editor. Used to display or edit text, hyperlinks, pictures, UI elements, and so on
Online Demo
Http://www.cnblogs.com/webabcd/archive/2010/08/09/1795417.html
Example
1, Viewbox's Demo
Viewboxdemo.xaml
Code
Xmlns= "Http://schema
more with the mouse, and use the idea of "Problem driven" to see which tool is used. The toolbox is mainly used for slide.
Controls and components ):
Text editing (in the editing box, enter the account password, and write a number during accounting)
Text editing mainly includes TextBox, RichTextBox, and MaskedTestBox.
Text display (users cannot edit, text display)
Label, LinkLabel, StatusStrip
Select from List
CheckListBox displays a list of items th
.
Finally, let's talk about the system of the Control extremely derived class. Control includes Background, border paint brush BorderBrush, Border Width BorderThickness, FontFamily, FontSize, FontWeight, Foreground color Foreground, and horizontal and vertical content, padding and Template of the control. Its Derived classes include ContentControl and ItemsControl, which represent controls with single content and controls with multiple content, as well as TextBoxBase and RangeBase.
The derived
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.