tangible是什么意思:如何调整 SSTab 时窗体中的该控件将调整大小

来源:百度文库 编辑:中财网 时间:2024/04/19 13:59:25
查看本文应用于的产品
  1. 打开一个新的标准 EXE 项目。默认情况下创建 Form1。
  2. 从项目菜单中选择组件。选择"Microsoft 选项卡式对话框控制"组件,然后单击确定。SSTab 控件添加到工具箱。
  3. 将放在 Form1 上的 SSTab 控件。标签属性更改为 2。
  4. 将命令按钮放在第一个选项卡 (制表符 0)。将第二个选项卡 (选项卡 1) 上的文本框控件。
  5. 将以下代码粘贴到 Form1 的代码窗口的通用声明部分中:
          Private Sub Form_Resize()         SSTab1.Move 0.1 * ScaleWidth, 0.1 * ScaleHeight, _            0.8 * ScaleWidth, 0.8 * ScaleHeight         Command1.Move 0.2 * SSTab1.Width, 0.2 * SSTab1.Height, _            0.4 * SSTab1.Width, 0.4 * SSTab1.Height         Text1.Move 0.4 * SSTab1.Width, 0.4 * SSTab1.Height, _            0.4 * SSTab1.Width, 0.4 * SSTab1.Height      ' NOTE: The Height property cannot be changed for the DriveListBox      ' control or for the ComboBox control, whose Style property setting      ' is 0 (Dropdown Combo) or 2 (Dropdown List). See the REFERENCES      ' section for an article that discusses how to resize a ComboBox.      End Sub
  6. 运行该项目。请注意出现在非活动选项卡控件调整不正确。
  7. 停止项目并从第 5 步将代码替换下面的代码:
          Private Sub Form_Resize()         Dim Ctl As Control, CtlCln As New Collection         On Error Resume Next         For Each Ctl In Controls            If Ctl.Left < 0 Then CtlCln.Add Ctl         Next         SSTab1.Visible = False         ' Add the code to resize the controls:         SSTab1.Move 0.1 * ScaleWidth, 0.1 * ScaleHeight, _            0.8 * ScaleWidth, 0.8 * ScaleHeight         Command1.Move 0.2 * SSTab1.Width, 0.2 * SSTab1.Height, _            0.4 * SSTab1.Width, 0.4 * SSTab1.Height         Text1.Move 0.4 * SSTab1.Width, 0.4 * SSTab1.Height, _            0.4 * SSTab1.Width, 0.4 * SSTab1.Height      ' NOTE: The Height property can't be changed for the DriveListBox      ' control or for the ComboBox control, whose Style property setting      ' is 0 (Dropdown Combo) or 2 (Dropdown List). See the REFERENCES      ' section for an article that discusses how to resize a ComboBox.         For Each Ctl In CtlCln            If Ctl.Left > 0 Then Ctl.Left = Ctl.Left - 75000         Next         SSTab1.Visible = True      End Sub
  8. 运行该项目。请注意该控件将调整大小正确。
回到顶端