tailieunhanh - microsoft visual basic 2008 step by step phần 8

bạn sẽ không thực sự tạo ra các chức năng toán học hoặc bất kỳ "nội dung" cho mô-đun, và sau đó bạn sẽ loại bỏ nó.) Tên tập tin của bạn cho mô-đun được cập nhật trong cửa sổ Properties, Solution Explorer, và biên tập Bộ luật. 8. Quay trở lại cửa sổ Properties và Giải pháp Explorer và | Chapter 14 Managing Windows Forms and Controls at Run Time 371 To Do this Create a new form with program code and set its properties Create the form by using the Dim and New keywords and the Form class and then set any necessary properties. For example Dim form2 As New Form My New Form Position a startup form on the Windows desktop Set the Startposition property to one of the available options such as CenterScreen or CenterParent. Size and position a startup form on the Windows desktop by using code Set the Startposition to Manual declare a Rectangle structure that defines the form s size and position and then use the DesktopBounds property to size and position the form on the desktop. For example Dim Form2Rect As New Rectangle _ 200 100 300 250 Form2Rect Minimize maximize or restore a form at run time Set the MaximizeBox and MinimizeBox properties for the form to True in design mode to allow for maximize and minimize operations. In the program code set the form s WindowState property to FormWindowState. Minimized or when you want to change the window state of the form. Add controls to a form at run time Create a control of the desired type set its properties and then add it to the form s Controls collection. For example Dim button1 as New Button Click Me New Point 20 25 button1 Anchor an object a specific distance from specific edges of the form Set the Anchor property of the object and specify the edges you want to remain a constant distance from. Use the Or operator when specifying multiple edges. For example Or _ Dock an object to one of the form s edges Set the Dock property of the object and specify the edge you want the object to be attached to. For example Specify the startup form in a project Click the

TỪ KHÓA LIÊN QUAN