2 problems
2 problems
(OP)
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?
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.





RE: 2 problems
Any better ideas on how to color a form in XL. Maybe write the bmp as a file, then load the file to an image!
Independent events are seldomly independent.
RE: 2 problems
The answer to your first question is that the code is not within a module of the project, but within the userform itself. It does need to call Userform1_Click because the userform is itself the only user form.
For the second question, Please put the entire code so that I could more easily troubleshoot your problem.
~chemebabak
RE: 2 problems
Let me think about that.
I hate Windowz 8!!!!