BigInch
Petroleum
- Jun 21, 2006
- 15,161
Using XL 2007
1) Working with a user form. The form's name is UserForm1. When I double click on the form while writing code for the form's events, the window opens with the event titled "UserForm_Click", but the form's name is actually "UserForm1". Should it not open with the title, "UserForm1_Click". Why would it be doing that? Also, when testing, an error of some kind sometimes causes XL to crash.
2) I am changing the form's pixel colors to colors stored in an RGB byte array "P"
DrawDC = DrawDibOpen()
DrawDibDraw DrawDC, Hdc, 1, 1, -1, -1, BInfo, P(1, 1), _
0, 0, BInfo.biWidth, BInfo.biHeight, 0
DrawDibClose DrawDC
That works fine (even though Hdc is DC of the handle to UserForm1), but if the form is covered by another program's window and then uncovered, the form does not automatically repaint. All previously colored areas that were covered are white when the covering program's window is moved away. Are the two problems related? I've seen some questions and solutions about forcing a repaint by including a DoEvents in a loop, but that was in regard to a progress bar that has a loop running. How can I force a repaint event without resorting to using some kind of timer control?
Independent events are seldomly independent.
1) Working with a user form. The form's name is UserForm1. When I double click on the form while writing code for the form's events, the window opens with the event titled "UserForm_Click", but the form's name is actually "UserForm1". Should it not open with the title, "UserForm1_Click". Why would it be doing that? Also, when testing, an error of some kind sometimes causes XL to crash.
2) I am changing the form's pixel colors to colors stored in an RGB byte array "P"
DrawDC = DrawDibOpen()
DrawDibDraw DrawDC, Hdc, 1, 1, -1, -1, BInfo, P(1, 1), _
0, 0, BInfo.biWidth, BInfo.biHeight, 0
DrawDibClose DrawDC
That works fine (even though Hdc is DC of the handle to UserForm1), but if the form is covered by another program's window and then uncovered, the form does not automatically repaint. All previously colored areas that were covered are white when the covering program's window is moved away. Are the two problems related? I've seen some questions and solutions about forcing a repaint by including a DoEvents in a loop, but that was in regard to a progress bar that has a loop running. How can I force a repaint event without resorting to using some kind of timer control?
Independent events are seldomly independent.