tailieunhanh - Mastering Microsoft Visual Basic 2010 phần 4

Các lệnh của trình đơn Format kiểm soát sự liên kết, các thuộc tính của font chữ của các lựa chọn hiện tại. Các lệnh Font hiển thị hộp thoại Font, và sau đó giao cho phông chữ được lựa chọn bởi người sử dụng đến lựa chọn hiện tại. Ví dụ 7,14 cho thấy các mã phía sau lệnh Font. | THE RICHTEXTBOX CONTROL 283 Listing Undoing and redoing actions Private Sub RedoToolStripMenuItem_Click . Handles If Then Editor .Redo End Sub Private Sub UndoToolStripMenuItem_Click . Handles If Then End Sub Calling the CanUndo and CanRedo method is unnecessary if the corresponding action can t be performed the two menu items will be disabled but an additional check does no harm. The Format Menu The commands of the Format menu control the alignment and the font attributes of the current selection. The Font command displays the Font dialog box and then assigns the font selected by the user to the current selection. Listing shows the code behind the Font command. Listing The Font command Private Sub FontToolStripMenuItem_Click . Handles If Not Is Nothing Then Else Nothing End If True If Then End If End Sub Notice that the code preselects a font in the dialog box the font of the current selection. If the current selection isn t formatted with a single font no font is preselected. To enable the Apply button of the Font dialog box set the control s ShowApply property to True and insert the following statement in its Apply event handler Private Sub FontDialog1_Apply . Handles End Sub 284 chapter 7 MORE WINDOWS CONTROLS The options of the Align menu set the RichTextBox control s SelectionAlignment property to different members of the HorizontalAlignment enumeration. The Align Left command for example is implemented with the following statement The Search Replace Dialog Box The Find command in the Edit menu opens the

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.