Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
'Form Level code Private Sub Form_Resize() ResizeControls Me End Sub Private Sub Form_Load() SaveSizes Me End Sub 'Module level code Private Type ControlPositionType Left As Single Top As Single Width As Single Height As Single FontSize As Single End Type Private m_ControlPositions() As ControlPositionType Private m_FormWid As Single Private m_FormHgt As Single ' Arrange the controls for the new size. Public Sub ResizeControls(frm As Form) Dim i As Integer Dim ctl As Control Dim x_scale As Single Dim y_scale As Single ' Don't bother if we are minimized. If WindowState = vbMinimized Then Exit Sub ' Get the form's current scale factors. 'If m_FormWid <> 0 And m_FormHgt <> 0 Then x_scale = frm.ScaleWidth / m_FormWid y_scale = frm.ScaleHeight / m_FormHgt 'End If ' Position the controls. i = 1 For Each ctl In frm.Controls With m_ControlPositions(i) If TypeOf ctl Is Line Then ctl.x1 = x_scale * .Left ctl.y1 = y_scale * .Top ctl.x2 = ctl.x1 + x_scale * .Width ctl.y2 = ctl.y1 + y_scale * .Height Else ctl.Left = x_scale * .Left ctl.Top = y_scale * .Top ctl.Width = x_scale * .Width If Not (TypeOf ctl Is ComboBox) Then ' Cannot change height of ComboBoxes. ctl.Height = y_scale * .Height End If On Error Resume Next ctl.Font.size = y_scale * .FontSize On Error GoTo 0 End If End With i = i + 1 Next ctl End Sub ' Save the form's and controls' dimensions. Public Sub SaveSizes(frm As Form) Dim i As Integer Dim ctl As Control ' Save the controls' positions and sizes. ReDim m_ControlPositions(1 To frm.Controls.Count) i = 1 For Each ctl In frm.Controls With m_ControlPositions(i) If TypeOf ctl Is Line Then .Left = ctl.x1 .Top = ctl.y1 .Width = ctl.x2 - ctl.x1 .Height = ctl.y2 - ctl.y1 Else .Left = ctl.Left .Top = ctl.Top .Width = ctl.Width .Height = ctl.Height On Error Resume Next .FontSize = ctl.Font.size On Error GoTo 0 End If End With i = i + 1 Next ctl ' Save the form's size. m_FormWid = frm.ScaleWidth m_FormHgt = frm.ScaleHeight End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.