Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ebook) Visual Studio .NET Mastering Visual Basic.pdf
Скачиваний:
120
Добавлен:
17.08.2013
Размер:
15.38 Mб
Скачать

SUMMARY 287

Listing 6.19: SelectionChanged Event Handler of the RichTextBox

Private Sub RichTextBox1_SelectionChanged(ByVal sender As Object, _ ByVal e As System.EventArgs) _

Handles RichTextBox1.SelectionChanged

TrackBar1.Value = (RichTextBox1.SelectionIndent / RichTextBox1.Width) * 100 TrackBar2.Value = TrackBar1.Value + _

(RichTextBox1.SelectionHangingIndent / RichTextBox1.Width) * 100

End Sub

Summary

In this chapter, you learned about the basic Windows controls, which are the main components in creating Windows forms. The TextBox and ListBox controls are two of the most common elements of the interface of just about any Windows application and include a whole lot of functionality. The other controls are also quite common but considerably easier to program.

In the following chapters, you will read about more Windows controls—specifically, in Chapter 7, the controls for displaying common dialog boxes (like the Font and Color dialog boxes) and the RichTextBox control. These are not trivial controls, and they deserve a detailed discussion.

There are several more Windows controls I am not going to discuss in this book. The DateTimePicker and MonthCalendar control are calendars that allow users to specify a date on a calendar, rather than typing it. The ToolBar and StatusBar controls are used to add tool bars (a narrow section with buttons at the top of the form) and status bars (a section with messages at the bottom of the form), and they are fairly easy to program. The functionality provided by these controls is too specific (and limited) compared to the functionality of the controls discussed in this and the following chapter.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com