473,805 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tool Window and Focus

I've a form that opens a tool window. The problem is that when the tool
window is opened, the main form itself passes focus to the toolwindow.

What I want and need is a toolwindow that works like a control with
tabstop=false, i.e. it doesn't get focus when the window is opened, but
focus is retained at the main form. And when you click a button on the
toolwindow, it processes the click event and returns focus to the main form.

Is that possible?

Cheers,
Johnny J.
Jul 24 '07 #1
3 3153

You could set the focus back to the main form after you show the tool bar.

Form myToolBar = new Form();
myToolBar.Show( );
this.Focus(); // focus back to the main form

Adrian.
--
[Please mark my answer if it was helpful to you]


"Johnny Jörgensen" wrote:
I've a form that opens a tool window. The problem is that when the tool
window is opened, the main form itself passes focus to the toolwindow.

What I want and need is a toolwindow that works like a control with
tabstop=false, i.e. it doesn't get focus when the window is opened, but
focus is retained at the main form. And when you click a button on the
toolwindow, it processes the click event and returns focus to the main form.

Is that possible?

Cheers,
Johnny J.
Jul 24 '07 #2
Tried that, but it doesn't work.

It goes into an endless loop somehow...

/Johnny J.

"Adrian Voicu" <Ad*********@di scussions.micro soft.comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
>
You could set the focus back to the main form after you show the tool bar.

Form myToolBar = new Form();
myToolBar.Show( );
this.Focus(); // focus back to the main form

Adrian.
--
[Please mark my answer if it was helpful to you]


"Johnny Jörgensen" wrote:
>I've a form that opens a tool window. The problem is that when the tool
window is opened, the main form itself passes focus to the toolwindow.

What I want and need is a toolwindow that works like a control with
tabstop=fals e, i.e. it doesn't get focus when the window is opened, but
focus is retained at the main form. And when you click a button on the
toolwindow, it processes the click event and returns focus to the main
form.

Is that possible?

Cheers,
Johnny J.

Jul 24 '07 #3

When does it go into an endless loop? Can you describe what is happening?

Adrian.
--
[Please mark my answer if it was helpful to you]


"Johnny Jörgensen" wrote:
Tried that, but it doesn't work.

It goes into an endless loop somehow...

/Johnny J.

"Adrian Voicu" <Ad*********@di scussions.micro soft.comwrote in message
news:C5******** *************** ***********@mic rosoft.com...

You could set the focus back to the main form after you show the tool bar.

Form myToolBar = new Form();
myToolBar.Show( );
this.Focus(); // focus back to the main form

Adrian.
--
[Please mark my answer if it was helpful to you]


"Johnny Jörgensen" wrote:
I've a form that opens a tool window. The problem is that when the tool
window is opened, the main form itself passes focus to the toolwindow.

What I want and need is a toolwindow that works like a control with
tabstop=false, i.e. it doesn't get focus when the window is opened, but
focus is retained at the main form. And when you click a button on the
toolwindow, it processes the click event and returns focus to the main
form.

Is that possible?

Cheers,
Johnny J.


Jul 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4228
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing windows to the front (top) in Netscape, IE and Opera. However, this command does nothing when you access the web page through AOL, even though they say this is IE. Once a window is behind (blurred), I have been unable to bring it back to the front...
9
48971
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a call to window.open As opposed to closing and re-opening new windows, I would prefer that when the user is finished reading the complete record, they can click a link whereby the main window is sent in to focus.
1
16606
by: Barry Svee | last post by:
I'm struggling with the JavaScript blur event. I have an activex control that I need to interact with when a window loses focus, namely to instruct it to give up control of a barcode scanner so that the application being brought foreward can take control. It has been my observation that when I set the window.onblur function, the window will gain focus and then immediately lose focus (blur) to the first field, button, or whatever that is...
31
2860
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy) on "main" does not setting the focus to "extern".
0
334
by: lukasz | last post by:
I'm looking for ideas how to implement a tool window with several buttons which, once clicked, should paste certain character in to the active EditBox in an other window of my application. The problem is to know which EditBox was focused before the focus went to the tool window, and then paste the character to the EditBox, but one apparent solution (logging all Windows events) is too time consuming. Lukasz
3
1502
by: Rudy Ray Moore | last post by:
Hi guys, I often use the "Find" (aka CTRL-F) tool in "Visual Studio .net 2003 7.1 c++". I noticed that that dialog box does not go away when I perform a search (it stays on the screen). This is different from the behavior of VS6. I find this frusterating because a mouse click is required to close the window (I cannot ALT-TAB back to the find window to press ESC).
5
4888
by: Mitchell Vincent | last post by:
I have an MDI child window that pops open it's own tool windows. I would like for the tool window to stay on top of that MDI child so that if they open the MDI child back up they *have* to dismiss the tool window to continue working.. I don't want this tool window to stay on top of others, though, as it will have nothing to do with other parts of the program.. Can I make the tool window a child of the MDI child window somehow? I hope I'm...
13
22179
by: tochiromifune | last post by:
Hello The window.open method brings my window to the top only if it is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in Mozilla/Firefox that I can ensure that this window comes to the top? Thank you for your help
4
68053
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between these forms that may make one succeed and another fail? In particular, this.window.focus() fails in Opera 9.10 with an "object not found", and windows.focus() succeeds in Opera 9.10, Firefox 2.02, and IE 7.
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10369
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.