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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Apr 8, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Handling the SysInfo Control

You can use the SysInfo control, distributed with VB5 and VB6, to write applications that can sport the Windows logo and that can behave intelligently when a system setting changes. The control fires the DisplayChanged event when the screen resolution changes, and it fires the SysColorChange event when the user modifies one or more system colors in the Control Panel.

For example, when you have a maximized form and the user switches to a higher screen resolution, VB correctly resizes the form to occupy a larger screen area. However, when the user switches to a lower resolution, VB doesn't resize the form accordingly. This code does the trick:

 
Private Sub SysInfo1_DisplayChanged()
	' If the form is maximized, restore it and
	' maximize it again
	With Me
		If .WindowState = vbMaximized Then
			.Visible = False
			.WindowState = vbNormal
			.WindowState = vbMaximized
			.Visible = True
		End If
	End With
End Sub
For more information on this topic, look on VB's Help file under "SysInfo."
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date