Ensure that a form’s TextBox and ComboBox controls have same height

Ensure that a form’s TextBox and ComboBox controls have same height

In general you don’t have any control on a ComboBox’s Height property, because it is determined automatically by VB depending on the font used for the ComboBox control. If you have a form that contains both TextBox and ComboBox controls, you should ensure that all your single-line TextBox controls are as tall as the ComboBox controls on the same form. The following routine can help you quickly set the Height property of all the single-line TextBox controls on a form:

' change the height of all the single-line TextBox in a formSub SetTextboxHeight(frm As Form, ByVal Height As Single)    Dim ctrl As Control        For Each ctrl In frm.Controls        If TypeOf ctrl Is TextBox Then            If ctrl.MultiLine = False Then                ctrl.Height = Height            End If        End If    NextEnd Sub

For example, if you have a Combo1 control on the Form1 form, you can ensure that all the TextBox control on that form are as tall as the ComboBox control with this line of code:

Private Sub Form_Load()    SetTextboxHeight Me, Combo1.HeightEnd Sub

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved