VB 控件随窗体自动调整大小.rar

时间:2022-07-30 11:19:49
【文件属性】:
文件名称:VB 控件随窗体自动调整大小.rar
文件大小:2KB
文件格式:RAR
更新时间:2022-07-30 11:19:49
VB源码-窗体界面 VB 控件随窗体自动调整大小,像窗口中的ListBox、Image、FileListBox、VB.Frame控件等,都可以随窗口的大小变化而变化,当用户拖动改变窗口大小时,这些控件的大小也会随之改变,这个功能的实现得益于自定义函数Form_Resize(),用此来控制各个控件的变化,来看代码:   Dim x, y As Long   x = Form1.Width - 200 - Frame1.Width - Image1.Width   y = (Frame1.Height - Drive1.Height - Drive1.Top - 200)   Frame1.Width = Frame1.Width x / 2   Image1.Left = Frame1.Left Frame1.Width 100   Image1.Width = Image1.Width x / 2   Image1.Height = Me.Height - 600   Frame1.Height = Image1.Height   Dir1.Width = Frame1.Width - 280   File1.Width = Dir1.Width   Drive1.Width = Dir1.Width   Dir1.Height = y / 3   File1.Top = Dir1.Top Dir1.Height 100   File1.Height = 2 / 3 * y   此段代码被封装在按钮事件中,请参见源代码文件。
【文件预览】:
codesc.net
----控件随窗体自动调整()
--------Form1.frm(2KB)
--------工程1.vbp(677B)
--------MSSCCPRJ.SCC(190B)
--------工程1.vbw(49B)

网友评论