OrigFont 360 End If 370 frm.Controls(lngCtl).Font.SIZE = dblFontSize 380 End If 390 If. OrigBold 250 Else 260 If UCase(TypeName(frm.Controls(lngCtl))) = "COMBOBOX" Then '160 dblFontSize = Frm.Controls(lngCtl).Font.SIZE * ((Frm.ScaleHeight / mlngFormScaleHeight) * 0.9) 270 dblFontSize = frm.Controls(lngCtl).Font.SIZE * ((frm.ScaleHeight / mlngFormScaleHeight) * 0.95) 280 Else '180 dblFontSize = Frm.Controls(lngCtl).Font.SIZE * ((Frm.ScaleHeight / mlngFormScaleHeight) * 0.8) 290 dblFontSize = frm.Controls(lngCtl).Font.SIZE * ((frm.ScaleHeight / mlngFormScaleHeight) * 0.9) 300 End If 310 End If 320 End If 330 If. OrigFont ' frm.Controls(lngCtl).Font.SIZE * (frm.ScaleHeight / mLastFormScaleHeight) 240 frm.Controls(lngCtl).Font.BOLD =. AdjustFont Then 220 If BackToNormal Then 230 dblFontSize =. ColHeadProp = frm.Controls(i).ColumnHeaderHeight / frm.ScaleHeight 330 End Select ' This line may need to be modified to add other tab control types 340 If UCase(TypeName(frm.Controls(i).Container)) = "SSTAB" And lngLeft "FRMMAIN" Then 110 If UCase(frm.Name) "TIMECLOCK" And UCase(frm.Name) "FRMPSMAIN" Then 120 BackToNormal = (UseHgt_PCT = 1) 130 Else 140 BackToNormal = (frm.ScaleHeight / mlngFormScaleHeight) = 1 150 End If 160 Else 170 BackToNormal = (frm.ScaleHeight / mlngFormScaleHeight) = 1 180 End If 190 For lngCtl = 0 To - 1 200 With mProportionsArray(lngCtl) ' move and resize objcontrols 210 If. RowProp = frm.Controls(i).RowHeight / frm.ScaleHeight 320. 230 lngLeftOffset = 0 240 lngLeft = frm.Controls(i).Left 250 Select Case UCase(TypeName(frm.Controls(i))) Case "LINE" 260. OrigWidth = frm.Controls(i).Width ' Controls on certain tab controls have -75000 added to their. OrigBold = frm.Controls(i).Font.BOLD 170 Else 180. OrigFont = frm.Controls(i).Font.SIZE 160. AdjustFont = CtlHasFont(frm.Controls(i)) 140 If. TopProportions = frm.Controls(i).Top / frm.ScaleHeight 130. WidthProportions = frm.Controls(i).Width / frm.ScaleWidth 120. HeightProportions = frm.Controls(i).Height / frm.ScaleHeight 110. If you intend to set the Height and width then I use a global Boolean called gbNotYet so that the resize does not get continue if you set the width, then the height such asĮnd Sub Option Explicit Private Type CtrlProportions Name As String Move As Boolean RESIZE As Boolean AdjustFont As Boolean HeightProportions As Single WidthProportions As Single TopProportions As Single LeftProportions As Single OrigHeight As Single OrigWidth As Single OrigFont As Single OrigBold As Boolean OX1 As Single OX2 As Single OY1 As Single OY2 As Single ' for the Janus Grid RowProp As Single ColHeadProp As Single End Type Private mProportionsArray() As CtrlProportions Private mlngFormScaleHeight As Long Private mLastFormScaleHeight As Long Public Sub Initialize(frm As Form) Dim i As Integer Dim lngLeft As Long Dim lngLeftOffset As Long 10 On Error Resume Next 20 If Not gbResizeOn Then Exit Sub 30 mlngFormScaleHeight = frm.ScaleHeight 40 ReDim mProportionsArray(0 To - 1) 50 For i = 0 To - 1 60 With mProportionsArray(i) 70. You just pass the form to the control in the Load Event once everything is set the way you want it. I have done the resize with a vb6 class control I wrote.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |