Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


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:

Click here to copy the following block
' change the height of all the single-line TextBox in a form

Sub 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
  Next
End 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:

Click here to copy the following block
Private Sub Form_Load()
  SetTextboxHeight Me, Combo1.Height
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.