PC Review


Reply
Thread Tools Rate Thread

Application.Visible = True and focus

 
 
hughie
Guest
Posts: n/a
 
      15th Jan 2007
Here's one for you..

I've got a modeless userform firing up after a 'Application.Visible =
False'. Because I want to get into the code and continue editing I've
added a 'view worksheet' button to the form that does a
'Application.Visible = True'. All is well..

...except that the worksheet is behind the userform and won't take focus
and come to the front. How can I get the two windows to behave
normally ie when you click on one it takes focus and comes to the
front?

tia,
Hughie

 
Reply With Quote
 
 
 
 
hughie
Guest
Posts: n/a
 
      15th Jan 2007
> Try showing your form vbModeless

> > I've got a modeless userform firing up...


I thought I mentioned that it IS modeless.

H

 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      16th Jan 2007
Hughie,
This works for me as expected:

<Worksheet code>
Private Sub CommandButton1_Click()
UserForm1.Show vbModeless
End Sub
</Worksheet code>

<Userform code>
Private Sub cmdHideExcel_Click()
Application.Visible = False
End Sub

Private Sub cmdShowExcel_Click()
Application.Visible = True
End Sub
</Userform code>

But the worksheet will always be behind the userform, although you can still
interact with the WS; Excel is designed that way.
You can .Hide the userform if you do not want it visible, but still loaded.

NickHK

"hughie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Here's one for you..
>
> I've got a modeless userform firing up after a 'Application.Visible =
> False'. Because I want to get into the code and continue editing I've
> added a 'view worksheet' button to the form that does a
> 'Application.Visible = True'. All is well..
>
> ..except that the worksheet is behind the userform and won't take focus
> and come to the front. How can I get the two windows to behave
> normally ie when you click on one it takes focus and comes to the
> front?
>
> tia,
> Hughie
>



 
Reply With Quote
 
hughie
Guest
Posts: n/a
 
      16th Jan 2007
> This works for me as expected:

> But the worksheet will always be behind the userform, although you can still
> interact with the WS; Excel is designed that way.
> You can .Hide the userform if you do not want it visible, but still loaded.


Oh I see. You might expect it but I didn't (arf!). I had put in a
..hide in any case.

thanks for help

Hughie

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching Panels using Visible =true & Visible=false; Kristof Taveirne Microsoft Dot NET Compact Framework 1 28th Jun 2006 03:50 PM
Switching Panels using Visible =true & Visible=false; Kristof Taveirne Microsoft C# .NET 2 28th Jun 2006 01:47 PM
Panel.Visible = True also make child controls visible. spamfurnace Microsoft ASP .NET 1 24th May 2004 04:07 AM
Visible = False / Visible = True Question david Microsoft Access Form Coding 0 14th Apr 2004 08:48 PM
Re: Visible = False / Visible = True Question Dirk Goldgar Microsoft Access Form Coding 0 14th Apr 2004 07:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 PM.