当前位置: 网学 > 编程文档 > VB > 正文

窗体控件大小随窗体大小变化而变化

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
bsp;       Else
                     ControlRecord(MaxControl).Top = inControl.Top
                     ControlRecord(MaxControl).Left = ActualPos(inControl.Left)
                     ControlRecord(MaxControl).Height = inControl.Height
                     ControlRecord(MaxControl).Width = inControl.Width
              End If

       inControl.IntegralHeight = False
       On Error GoTo 0
       AddControl = MaxControl
       MaxControl = MaxControl + 1
End Function


Function PerWidth(pfrmIn As Form) As Long

       Dim i As Long
       i = FindForm(pfrmIn)

              If i < 0 Then
                     i = AddForm(pfrmIn)
              End If

       PerWidth = (pfrmIn.ScaleWidth * 100) \ FormRecord(i).ScaleWidth
End Function


Function PerHeight(pfrmIn As Form) As Double

       Dim i As Long
       i = FindForm(pfrmIn)

              If i < 0 Then
                     i = AddForm(pfrmIn)
              End If

       PerHeight = (pfrmIn.ScaleHeight * 100) \ FormRecord(i).ScaleHeight
End Function


Public Sub ResizeControl(inControl As Control, pfrmIn As Form)

       On Error Resume Next
       Dim i As Long
       Dim widthfactor As Single, heightfactor As Single
       Dim minFactor As Single
       Dim yRatio, xRatio, lTop, lLeft, lWidth, lHeight As Long
       yRatio = PerHeight(pfrmIn)
       xRatio = PerWidth(pfrmIn)
       i = FindControl(inControl, pfrmIn.Name)

&
  • 上一篇资讯: 浅谈VB编写病毒的思路
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号