How can i create a form which cannot get Active / Focus ?

  • Thread starter Thread starter dulo
  • Start date Start date
I fear that I don’t quite understand what you hope to achieve... are you
wanting to create a form that is always hidden and never visible or
selectable? Are you wanting to prevent events such as Activated from ever
being raised by it but still allowing controls on the form to be triggered
and/or display from the form to still occur?

Brendan
 
Brendan said:
I fear that I don’t quite understand what you hope to achieve... are you
wanting to create a form that is always hidden and never visible or
selectable? Are you wanting to prevent events such as Activated from ever
being raised by it but still allowing controls on the form to be triggered
and/or display from the form to still occur?

Brendan


:
I want a form which is of course visible , but i dont want it to snatch
focus / becoming active.
I want to write a dockable toolbar and i have multiple target windows.
If the toolbar gets the focus / becomes active i dont know anymore which
control is the target of the toolbar action.
You could also imagine to write a onscreen keyboard which should of
course not snatch focus from a textbox which should be filled with text.
I hope you understand me now.

thx Dulo
 
Would it be acceptable to let the toolbar have focus & simply have a
variable that's a Form reference that holds the last active document
window or whatever type you are interested in applying the tools action
to?

You could then even use the var to set the window active when a toolbar
button was pressed.
 
Would it be acceptable to let the toolbar have focus & simply have a
variable that's a Form reference that holds the last active document
window or whatever type you are interested in applying the tools action
to?

You could then even use the var to set the window active when a toolbar
button was pressed.

I want to mimic the behaviour of devstudio2003 which doesnt activate the
mainwindow is you click on a docked toolbar or menubar.

An if i am "in" the toolbar i can not detect which form / control had
focus before it got activated.

thx Dulo
 
Ignacio said:
hi

did you try Form.Enabled

cheers,
I tried Form.enabled which does prevent controls in the form from
getting focus , but the form gets active and i loose the information
which form was active before.

i can remember in mfc it was possible to create a window which couldnt
get focus.

thx dulo
 
Have you tried looking at the VisualStudio2003 window in Spy++ to see what
its attributes are?

Frisky
 
I got a tip to handle
WM_MOUSEACTIVATE and returning MA_NOACTIVATE. Then it posts
WM_LBUTTONDOWN and WM_LBUTTONUP messages to itself to simulate that a
click took place.
But how can i do that in .net ?
The WndProc Message in .net does not have a returnvalue.

thx Dulo
 
Back
Top