Click here to Skip to main content
13,863,289 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


37 bookmarked
Posted 5 Aug 2011
Licenced CPOL

Screen Brightness Control for Laptops and Tablets

, 7 Aug 2011
Rate this:
Please Sign up or sign in to vote.
A tiny program for quickly adjusting the screen brightness of your laptop or tablet PC


With this little tool, you can quickly adjust the screen brightness of your laptop or tablet. It also supports commandline arguments to fit your needs.


I recently bought a tablet and wasn't quite satisfied with how to change the screen brightness. So I searched the web for a simple solution - but had no success. First, I hit on the IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS Control but many people struggled with invoking it in C# - in fact, I found only one person that seemed to have managed it... but this thread was closed and I found no way to contact him - *lol* - so I tried another workaround some people suggested and screwed up my gamma and contrast settings - haha - finally I found this page of Samuel Lai - he made a simple sidebar gadget using WMI to access the screen brightness control and also provided some code - funny, as during my search I often read people saying that there is no support in C#. Later on, I realized that I should have taken a closer look at the IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS Control site as Microsoft says here that this control is no longer supported and one should use the WmiMonitorBrightness Class... O.K., whatever - enough blabla :)

Using the Code/Program

The Program

I've tested the program on Win7 (x86) - AFAIK, it won't work on ordinary PCs, as they don't have the necessary hardware support for this. In case of an incompatible system, a message will pop up and the program will quit.

I used VS2010 and .NET 4 for building - therefore, you will need .NET 4 to run the program and VS2010 to change the code... probably you can use a lower version of VS, but AFAIK, the designer isn't compatible.

Well, when starting the program without arguments, it will hide and an icon shows up in the taskbar infoarea. The trackbar shows up by clicking on the icon. Right clicking the icon will open an exit popup.


  • quit - The trackbar shows up and will close after 4 secs of inactivity.
  • show - The trackbar shows up and will hide after 4 secs of inactivity.
    Well, in fact, you can type anything in order to gain this result - unless it's not listed here as argument...^^
  • hide - will hide the form initially - this is only useful in combination with a brightnesslevel statement:
  • brightnesslevel in % - You can pass a level statement to set the brightness immediately (e.g. 25% ) - the level is set to the next higher available level, if the argument is not in the level array

Arguments are seperated by blanks!
e.g. ScreenBrightness 10% quit
ScreenBrightness hide 55%</strong />
The order of the arguments is not relevant.

The Code

Well, I've used the WMI queries from Samuel Lai and wrapped around the visual stuff...
The WmiMonitorBrightness class offers a handful of read-only properties about the actual brightness settings: Active, CurrentBrightness, InstanceName, Level and Levels.

A point of interest might be the Level property as it is an array of valid brightnesslevels supported by the hardware. They may differ from machine to machine. E.g. my laptop has only 7 levels while my tablet has 10.

My app has only support for one screen - if you have multiple screens, you'll need to query each separately, as I've understood... though I don't see a method for setting the brightness for an individual screen...?

The WmiMonitorBrightnessMethods class is used for setting the screen brightness via the WmiSetBrightness method.

So far, hope you'll like it! :)


  • 4th August, 2011: Initial version
  • 6th August, 2011: Minor update
    • Included actual brightness value in tooltip text of icon
    • Actual brightness value of form will refresh when opening form or moving mouse over icon


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer Engineering office for automation Dr. Lupp
Germany Germany
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionHELP! Convert to VB ? Pin
InfinityJoe10-Dec-17 3:23
memberInfinityJoe10-Dec-17 3:23 
AnswerRe: HELP! Convert to VB ? Pin
stepe6-Mar-18 4:37
memberstepe6-Mar-18 4:37 
QuestionCan you add more code explanation? Pin
Kunal Chowdhury «IN»27-Jan-17 0:40
mentorKunal Chowdhury «IN»27-Jan-17 0:40 
QuestionNegative backlight value Pin
Prittyokname1-Feb-15 15:30
memberPrittyokname1-Feb-15 15:30 
QuestionUSB display Pin
ankit_sam28-Jun-13 18:30
memberankit_sam28-Jun-13 18:30 
Generalworks! Pin
Member 95672142-Nov-12 10:32
memberMember 95672142-Nov-12 10:32 
Questioncan't run in my computer Pin
ainichenwei13-Sep-12 19:00
memberainichenwei13-Sep-12 19:00 
AnswerRe: can't run in my computer Pin
stepe14-Sep-12 6:42
memberstepe14-Sep-12 6:42 
AnswerRe: can't run in my computer Pin
stepe14-Sep-12 7:14
memberstepe14-Sep-12 7:14 
GeneralMy vote of 4 Pin
artal yetmisuc18-Aug-12 11:48
memberartal yetmisuc18-Aug-12 11:48 
QuestionNice Work Pin
Mc Gwyn27-Sep-11 0:32
memberMc Gwyn27-Sep-11 0:32 
AnswerRe: Nice Work Pin
stepe27-Sep-11 0:51
memberstepe27-Sep-11 0:51 
GeneralRe: Nice Work Pin
Mc Gwyn27-Sep-11 2:09
memberMc Gwyn27-Sep-11 2:09 
GeneralMy vote of 5 Pin
TeapotDev8-Aug-11 4:12
memberTeapotDev8-Aug-11 4:12 
GeneralMy 5..... Pin
MaulikDusara7-Aug-11 18:39
memberMaulikDusara7-Aug-11 18:39 
QuestionMy vote of 5 Pin
Filip D'haene5-Aug-11 23:53
memberFilip D'haene5-Aug-11 23:53 
AnswerRe: My vote of 5 Pin
stepe6-Aug-11 12:17
memberstepe6-Aug-11 12:17 
GeneralMy vote of 5 Pin
mbcrump5-Aug-11 10:38
mentormbcrump5-Aug-11 10:38 
SuggestionThis worked better for me... Pin
andre123455-Aug-11 7:50
memberandre123455-Aug-11 7:50 
GeneralRe: This worked better for me... Pin
stepe5-Aug-11 8:08
memberstepe5-Aug-11 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190214.1 | Last Updated 7 Aug 2011
Article Copyright 2011 by stepe
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid