Đang chuẩn bị liên kết để tải về tài liệu:
Pro VB 2005 and the .NET 2.0 Platform Second Edition phần 8

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Vì vậy, nếu bạn muốn đăng ký CarService như là một loại WKO-đơn có sẵn thông qua HTTP, bạn có thể thêm đoạn mã sau vào phương pháp onStart () (tất nhiên, bạn cũng có thể chọn để tự động đọc các thông tin truy cập từ xa từ một *. tập tin cấu hình) | CHAPTER 23 PROGRAMMING WITH WINDOWS FORMS CONTROLS 715 Figure 23-4. The many faces of the TextBox type Figure 23-5. Extracting values from TextBox types Fun with MaskedTextBoxes As of .NET 2.0 we now have a masked text box that allows us to specify a valid sequence of characters that will be accepted by the input area Social Security number phone number with area code zip code or whatnot . The mask to test against termed a mask expression is established using specific tokens embedded into a string literal. Once you have created a mask expression this value is assigned to the Mask property. Table 23-3 documents some but not all valid masking tokens. Table 23-3. Mask Tokens ofMaskedTextBox Mask Token Meaning in Life 0 Represents a mandatory digit with the value 0-9 9 L Represents an optional digit or a space Required letter in uppercase or lowercase A-Z Optional letter in uppercase or lowercase A-Z Represents a thousands separator placeholder Represents a time placeholder Represents a date placeholder Represents a currency symbol 716 CHAPTER 23 PROGRAMMING WITH WINDOWS FORMS CONTROLS Note The characters understood by the MaskedTextBox do not directly map to the syntax of regular expressions. Although .NET provides namespaces to work with proper regular expressions System.Text.RegularExpressions and System.Web.RegularExpressions the MaskedTextBox uses syntax based on the legacy MaskedEdit VB6 COM control. In addition to the Mask property the MaskedTextBox has additional members that determine how this control should respond if the user enters incorrect data. For example BeepOnError will cause the control to obviously issue a beep when the mask is not honored and it prevents the illegal character from being processed. To illustrate the use of the MaskedTextBox add an additional Label and MaskedTextBox to your current Form. Although you are free to build a mask pattern directly in code the Properties window provides an ellipsis button for the Mask property that will .