473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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 3134

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*********@discussions.microsoft.comwrote in message
news:C5**********************************@microsof t.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 #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*********@discussions.microsoft.comwrote in message
news:C5**********************************@microsof t.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
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...
9
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...
1
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...
31
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...
0
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...
3
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...
5
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...
13
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.