Modeless User Form Is Blank

L

Lucky

I want a modeless user form to appear, then my program does some work
(clearing the screens of all drawing objects, which takes a while),
and then the user form to unload. I've gotten this to work, except
that the user form is completely blank and white. The label control
with my message doesn't show. I've tried DoEvents before showing the
form, repaint in the form initalize (as suggested in other posts on
this topic), and this doesn't help.
 
J

joel

What controls did you add to the Userform using the toolbox in the VB
wndow menu?

You should add either a Label or Text box and manually add the Text t
the control. You don't need to do this inside a macro if you want th
same message to appear everytime. Make sure you eliminate all th
writes to the control in your macro.
 
L

Lucky

I put a label control on the form (using the toolbox when I set it up)
with text that basically says "please wait". There is no code in the
form's module, and I don't interact with the form while it is
showing. I just want it to appear with the message, stay on the
screen while I do some other work, then go away. Seems simple
enough. It does appear, and when I finish the other work, it does go
away. But it is blank.
 
J

joel

What you have should work. That is why I said to make sure you aren'
writing to the control an erasing any text inside the control. Yo
could also have the wrong color for the font that won't contrast wit
the userform color.


You can veiw all the properties of the Userform and Control a
follows.

From VBa - View Properties Window.
then either click on the userform or contrl and the properties for th
object will show in the properties window. check the font color an
background color to make sure the color will contrast so you can see th
text. the text words should be seen in the control properties.
 
L

Lucky

Joel,

Thanks for discussing this with me. I've made lots and lots of user
forms, but this is the first time I've tried to use one as modeless.
The form looks fine in design view, and as I said, I don't interact
with it when it is on the screen. Screen updating is turned off by my
code after the form is displayed, so it's already on the screen by
that time, so it seems that it should be just fine. I'm at a loss as
to why this is happening. My program is big and uses lots of shapes
on lots of screens, so the only thing I can think of is that maybe I'm
running out of memory. I've tried everything I can think of, so I
guess I'll just dump the form and try something else, maybe using the
status bar for my "please wait" message. Oh, well. Thanks again,
Lucky
 
M

Mishell

Put your DoEvents after showing the form.

UserForm1.Show vbModeless
DoEvents

Mishell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top