Click here to Skip to main content
14,326,294 members

Visual Basic

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:40
adminChris Maunder12-Jul-09 22:40 
PinnedHow to get an answer to your question PinPopular
Chris Maunder10-Nov-05 16:30
adminChris Maunder10-Nov-05 16:30 
Questionhow i create a video conference program Pin
Member 1462143013-Oct-19 8:09
memberMember 1462143013-Oct-19 8:09 
AnswerRe: how i create a video conference program Pin
Dave Kreskowiak13-Oct-19 16:05
mveDave Kreskowiak13-Oct-19 16:05 
QuestionStepper Motor control code Pin
Member 1462018511-Oct-19 12:10
memberMember 1462018511-Oct-19 12:10 
AnswerRe: Stepper Motor control code Pin
Eddy Vluggen11-Oct-19 12:44
mveEddy Vluggen11-Oct-19 12:44 
QuestionMove to Windows 10 on HP messes up display Pin
Todd (10789346)9-Oct-19 4:30
memberTodd (10789346)9-Oct-19 4:30 
Hello!
What is the code to force Windows to refresh the display settings?
I have a VB .NET Forms application that has been steadily updated long enough that it has moved through multiple .NET versions and deployed across Windows XP, Windows 7, and now Windows 10 (we were able to avoid Vista and 8).

Now, on Windows 10 running on an HP, I have a display problem. The problem in the HP, but there is a work around that I would like to trigger from the application.

To fix the problem, after launching the app (from DEV or EXE):
1) Dock / Undock (switching between native and attached displays)
2) Open display settings and change something (resolution, scale, etc.)
3) Perform some other, similar display adjustment that requires the OS to update all of the resolution/scaling constants.

In each case, when change the display or display settings, the problem is resolved, and when I change back, things continue to work fine. It also does not matter if I start on the laptop display or the attached displays. I can duplicate the behavior and fix on multiple HPs running windows 10.

What I need is code to force Windows to refresh the display settings.
Background:
The problem is clearly in the OS, likely the display driver. However, HP has been having issues with display drivers ever since the rush to market with the Thunderbolt and they have yet to fix most of those problems. HP blames Microsoft, Microsoft blames HP, nothing gets fixed.

Using app level functions, such as Refresh, and PerformAutoScale do not do the trick. The problem appears to be that windows is reporting different values to the application on container size, and usable size. The app initially draws the controls to the correct container size, but then only repaints a smaller usable size.

Making the window smaller (reducing the container size to below the apparent usable size) and then bigger again, does not make the problem go away - there is a fixed "usable size" that the app will not repaint beyond the borders of, even when the container goes beyond that size. What is interesting about this is that the app will update the data in the controls beyond this "usable size" - it just doesn't properly repaint, instead it adds the new text on top of the old text. It also leaves behind the drawn window edges as the container is sized larger.

Another interesting tidbit is that I can run the app, perform the work around to "fix" the problem, and then close the app. Upon reopening the app, the problem returns, and the work around is again required.

Please help with both a code driven work around, or even better, an OS level fix.

The particulars:
1) VB .NET in Visual Studio 2017 (version 15.9.16)
2) Windows 10 (up to date per Microsoft)
3) HP ZBook Mobile Workstation "Bang & Olufsen" with i7, lots of memory (has no problem with Solid Works 2017)
4) Display drivers for both laptop internal, and Thunderbolt dock external up to date
5) Behavior duplicated on second HP (same config) with Windows 10; same app continues to run just peachy on second HO (same config) running Windows 7.
Todd

AnswerRe: Move to Windows 10 on HP messes up display Pin
Gerry Schmitz9-Oct-19 9:18
mveGerry Schmitz9-Oct-19 9:18 
AnswerRe: Move to Windows 10 on HP messes up display Pin
jkirkerx10-Oct-19 14:11
professionaljkirkerx10-Oct-19 14:11 
PraiseBuffer Not Retreive English language Pin
Member 118036078-Oct-19 4:37
memberMember 118036078-Oct-19 4:37 
AnswerRe: Buffer Not Retreive English language Pin
Richard MacCutchan8-Oct-19 5:18
protectorRichard MacCutchan8-Oct-19 5:18 
GeneralRe: Buffer Not Retreive English language Pin
Member 118036078-Oct-19 5:28
memberMember 118036078-Oct-19 5:28 
GeneralRe: Buffer Not Retreive English language Pin
Richard MacCutchan8-Oct-19 6:16
protectorRichard MacCutchan8-Oct-19 6:16 
GeneralRe: Buffer Not Retreive English language Pin
Member 118036078-Oct-19 7:12
memberMember 118036078-Oct-19 7:12 
GeneralRe: Buffer Not Retreive English language Pin
Richard MacCutchan8-Oct-19 7:56
protectorRichard MacCutchan8-Oct-19 7:56 
QuestionToolTip Does not display(WIN32-API) Pin
Member 118036077-Oct-19 4:51
memberMember 118036077-Oct-19 4:51 
Questionassing arguments in vb6.0 ? Pin
Member 24584676-Oct-19 23:55
memberMember 24584676-Oct-19 23:55 
AnswerRe: assing arguments in vb6.0 ? Pin
Mycroft Holmes7-Oct-19 12:40
memberMycroft Holmes7-Oct-19 12:40 
QuestionCreate Button(win32) But Not Receive Message Pin
Member 118036076-Oct-19 4:31
memberMember 118036076-Oct-19 4:31 
AnswerRe: Create Button(win32) But Not Receive Message Pin
Dave Kreskowiak6-Oct-19 5:04
mveDave Kreskowiak6-Oct-19 5:04 
GeneralRe: Create Button(win32) But Not Receive Message Pin
Member 118036076-Oct-19 5:25
memberMember 118036076-Oct-19 5:25 
GeneralRe: Create Button(win32) But Not Receive Message Pin
Richard MacCutchan6-Oct-19 5:53
protectorRichard MacCutchan6-Oct-19 5:53 
GeneralRe: Create Button(win32) But Not Receive Message Pin
Member 118036076-Oct-19 5:59
memberMember 118036076-Oct-19 5:59 
GeneralRe: Create Button(win32) But Not Receive Message Pin
Richard MacCutchan6-Oct-19 6:11
protectorRichard MacCutchan6-Oct-19 6:11 
GeneralRe: Create Button(win32) But Not Receive Message Pin
Member 118036076-Oct-19 6:40
memberMember 118036076-Oct-19 6:40 

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.