none
Adjust/Change Brightness of VB Form RRS feed

  • Question

  • Hey guys

    I was wondering if it was possible to change the brightness and/or contrast of an individual form or the program. I've looked around on the internet and all I've seen is changing the brightness of the entire monitor. Is it possible to change the form brightness? 

    Monday, October 8, 2018 2:57 AM

All replies

  • Hi,

    1.Add control HScrollBar

    2.Set the value of the HScrollBar property to 100

    3.Add  Scroll event to HScrollBar

    Public Class Form1
        Private Sub HScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles HScrollBar1.Scroll
            Dim x As Double
            x = Convert.ToDouble(HScrollBar1.Value)
            Me.Opacity = x / 100
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 8, 2018 6:35 AM
  • Thanks for the help Alex. I tried putting in your suggested code but that only changes the form opacity, which is not what I wanted. The current method I am using which changes the entire monitor uses a RAMP structure.
    Saturday, October 13, 2018 10:38 PM
  • Thanks for the help Alex. I tried putting in your suggested code but that only changes the form opacity, which is not what I wanted. The current method I am using which changes the entire monitor uses a RAMP structure.

    I am not familiar with RAMP, but, I don't think you can change the brightness the same way as the monitor for a form or other window from vb.

    You can change the image brightness of a captured form or any image bitmap. Will that do?

    https://docs.rainmeter.net/tips/colormatrix-guide/

    Saturday, October 13, 2018 11:04 PM
  • You can take intrinsic control of the color of every UI element - all the background and border colors, and all the foreground text colors. You can even dim pictures. Keep all your colors in a source RGB table, and use maths to re-define all the colors according to the user's scrollbar choice, then refresh the UI. The whole form can be dimmed or brightened in real time as the user slides the scrollbar.

    Burn all valuable data to CD/DVD disks. EMP proof.

    Sunday, October 14, 2018 1:54 AM
  • A way is with a layered window drawn over the Form (with UpdateLayeredWindow)

    Sunday, October 14, 2018 2:14 AM