Is there any way of getting the monitors optimal resolution in vb?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Optimal Resolution Based on Advices
If you want the optimal resolution for a CRT then you can follow Microsoft’s advice (because there is no native resolution for a CRT):
If you want the optimal resolution for a LCD monitor then you have to use its native resolution. Usually it’s the highest resolution available for the monitor.
Ways of Getting Optimal Resolution
You can get resolution information from various sources:
Optimal Resolution Based on VB Code
I’ll use some WMI to query the resolution informations. We can use the Win32_VideoSettings class which gives us available resolutions by video controller but I had some funny/sad/empty results with it. For this one, I’m using the CIM_VideoControllerResolution class directly to get the maximum resolution:
Note: if you want to get the resfresh rate, you can get it with the ‘RefreshRate’ property (ex. vidSetting(“RefreshRate”) )