Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Mar 8, 2002

Center Your Logo on MDI Forms


You can display a logo in the middle of your MDI form. The logo stays in the middle even when the MDI form is resized. After creating your own MDI form, add a standard form to your project and put an Image control named imgLogo on it. Instead of the Image control, you can use a Label control or whatever you want. The standard form (frmLogo) should have these properties set:
 
PROPERTIES of frmLogo:
MDIChild = True
BorderStyle = 0 - None
Then put this code in your MDI form Resize event:
Private Sub MDIForm_Resize()
' Now center the frmLogo form in your MDI form
frmLogo.Left = (Me.ScaleWidth - frmLogo.Width) / 2
frmLogo.Top = (Me.ScaleHeight - frmLogo.Height) / 2
End Sub
Put this code in the logo form
Pavel Tsekov
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date