ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to force userform to display everything? (https://www.excelbanter.com/excel-programming/313357-how-force-userform-display-everything.html)

John Mitchell

How to force userform to display everything?
 
If I do the following...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
end with

The form displays but the text box doesn't show. It's as if the form had
no controls. However, if I add a msgbox command...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
msgbox "Press OK to continue.."
end with

The modal form displays correctly.

How can I get the modal form to do what I want without having to wait
for input, which defeats the whole purpose of using a modal form to pass
information?

Regards, John M

Doug Glancy

How to force userform to display everything?
 
John,

I can't reproduce, so just a guess - maybe Repaint would force it:

With UserForm1
.TextBox1.Value = "Some text to display"
.Show (modal)
.Repaint
End With

hth,

Doug Glancy

"John Mitchell" wrote in message
...
If I do the following...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
end with

The form displays but the text box doesn't show. It's as if the form had
no controls. However, if I add a msgbox command...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
msgbox "Press OK to continue.."
end with

The modal form displays correctly.

How can I get the modal form to do what I want without having to wait
for input, which defeats the whole purpose of using a modal form to pass
information?

Regards, John M




John Mitchell

How to force userform to display everything?
 
Doug

Thanks. That did the trick.

Regards, John M

Doug Glancy wrote:
John,

I can't reproduce, so just a guess - maybe Repaint would force it:

With UserForm1
.TextBox1.Value = "Some text to display"
.Show (modal)
.Repaint
End With

hth,

Doug Glancy

"John Mitchell" wrote in message
...

If I do the following...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
end with

The form displays but the text box doesn't show. It's as if the form had
no controls. However, if I add a msgbox command...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
msgbox "Press OK to continue.."
end with

The modal form displays correctly.

How can I get the modal form to do what I want without having to wait
for input, which defeats the whole purpose of using a modal form to pass
information?

Regards, John M





Tom Ogilvy

How to force userform to display everything?
 
Note that you are showing your userform as a Modeless userform (not modal as
you claim). Modal would mean that it retains the focus until dropped.

(modal)
is not a constant and resolves to 0 as you use it. Zero is the value of the
defined constant vbModeless

? vbModeless
0
The constant for modal is

? vbModal
1

It usually helps to use correct terminology.


--
Regards,
Tom Ogilvy

"John Mitchell" wrote in message
...
Doug

Thanks. That did the trick.

Regards, John M

Doug Glancy wrote:
John,

I can't reproduce, so just a guess - maybe Repaint would force it:

With UserForm1
.TextBox1.Value = "Some text to display"
.Show (modal)
.Repaint
End With

hth,

Doug Glancy

"John Mitchell" wrote in message
...

If I do the following...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
end with

The form displays but the text box doesn't show. It's as if the form had
no controls. However, if I add a msgbox command...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
msgbox "Press OK to continue.."
end with

The modal form displays correctly.

How can I get the modal form to do what I want without having to wait
for input, which defeats the whole purpose of using a modal form to pass
information?

Regards, John M








All times are GMT +1. The time now is 09:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com