tailieunhanh - Mastering Microsoft Visual Basic 2008 phần 7

Chỉ cần về bất kỳ ứng dụng cho phép người dùng nhập vào phải lưu trữ dữ liệu của nó vào một tập tin (hoặc nhiều tập tin) để thu hồi sau cơ sở dữ liệu loại trừ, tất nhiên. Thao tác tập tin và thư mục là khá phổ biến, quá. Tổ chức các tập tin vào thư mục và các tập tin xử lý hàng loạt là hai ví dụ điển hình. | DRAWING WITH GDI 655 WHEN Do We Initialize a Graphics Object The Graphics object is initialized to the control s drawing surface at the moment you create it. If the form is resized at runtime the Graphics object won t change and part of the drawing surface might not be available for drawing. If you create a Graphics object to represent a form in the form s Load event handler and the form is resized at runtime the drawing methods you apply to the Graphics object will take effect in part of the form. The most appropriate event for initializing the Graphics object and inserting the painting code is the form s Paint event. This event is fired when the form must be redrawn when the form is uncovered or resized. Insert your drawing code there and create a Graphics object in the Paint event handler. Then draw on the Graphics object and release it when you re done. The Graphics object exposes the following basic properties in addition to the drawing methods discussed in the following sections. DpiX DpiY These two properties return the horizontal and vertical resolutions of the drawing surface respectively. Resolution is expressed in pixels per inch or dots per inch if the drawing surface is your printer . On an average monitor these two properties return a resolution of 96 dots per inch dpi . PageUnit This property determines the units in which you want to express the coordinates on the Graphics object its value can be a member of the GraphicsUnit enumeration Table . If you set the PageUnit property to World you must also set the PageScale property to a scaling factor that will be used to convert world units to pixels. TABLE The GraphicsUnit Enumeration VALUE DESCRIPTION Display The unit is 1 75 of an inch. Document The unit is 1 300 of an inch. Inch The unit is 1 inch. Millimeter The unit is 1 millimeter. Pixel The unit is 1 pixel the default value . Point The unit is a printer s point 1 72 of an inch . World The developer specifies the unit to be used. .

TỪ KHÓA LIÊN QUAN