TAILIEUCHUNG - Manning Windows Forms Programming (phần 4)

Tham khảo tài liệu 'manning windows forms programming (phần 4)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | .NET Table StatusBarPanel class The StatusBarPanel class is a component that appears as a panel within a statusBar control. This class is part of the namespace and inherits from the class. A panel must be associated with a StatusBar instance with its showPanels property set to true in order to appear on a form. Alignment Gets or sets the HorizontalAlignment for the panel s text. AutoSize Gets or sets how the panel is sized within the status bar. BorderStyle Gets or sets the type of border to display for the panel if any. MinWidth Gets or sets the minimum width for the panel. Public Properties Parent Gets the StatusBar object that contains this panel. Style Gets or sets the style used to draw the panel. Text Gets or sets the text for the panel. ToolTipText Gets or sets the tool tip for the panel. Width Gets the current width or sets the default width for the panel. BeginInit Begins initialization of the panel when used within a form or other component. Public Methods EndInit Ends initialization of the panel when used within a form or other component. Assigning panel text With our panels defined we simply set the Text property value for each panel to have the text displayed by the application. This only works for panels with their Style property set to Text of course. We will look at our owner-drawn panel in section . Since our panels only have meaning after an image is loaded we assign their values as part of the Click event handler for the Load button as indicated by the following steps. SET THE TEXT TO APPEAR IN THE PANELS Action Result 1 In the menuLoad_Click method set the ShowPanels property to false while the image is loading. private void menuLoad_Click object sender e . try false 116 chapter 4 Status bars Set the text to appear in the panels continued Action Result 2 Initialize the sbpnlFileName and sbpnlImageSize panels after the image is successfully .

TỪ KHÓA LIÊN QUAN