Click here to Skip to main content
15,887,812 members
Home / Discussions / C#
   

C#

 
GeneralRe: Showing a Form as a drop-down menu Pin
J. Dunlap15-Jun-03 8:14
J. Dunlap15-Jun-03 8:14 
GeneralRe: Showing a Form as a drop-down menu Pin
Patrick Bristow15-Jun-03 8:44
Patrick Bristow15-Jun-03 8:44 
GeneralRe: Showing a Form as a drop-down menu Pin
J. Dunlap15-Jun-03 9:15
J. Dunlap15-Jun-03 9:15 
GeneralRe: Showing a Form as a drop-down menu Pin
Patrick Bristow15-Jun-03 9:28
Patrick Bristow15-Jun-03 9:28 
GeneralRe: Showing a Form as a drop-down menu Pin
J. Dunlap15-Jun-03 10:45
J. Dunlap15-Jun-03 10:45 
GeneralI've got it! Pin
J. Dunlap15-Jun-03 11:27
J. Dunlap15-Jun-03 11:27 
GeneralRe: I've got it! Pin
Patrick Bristow15-Jun-03 11:35
Patrick Bristow15-Jun-03 11:35 
GeneralRe: I've got it! [UPDATED] Pin
J. Dunlap15-Jun-03 11:40
J. Dunlap15-Jun-03 11:40 
Just use the SetWindowLong API:

[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int Index, int NewLong);

For the styles to take effect, you'll need to do SetWindowPos with the flags set to SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE SWP_NOMOVE .

Here's the import for SetWindowPos:

[DllImport("user32.dll")]
private static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter,int x,int y, int cx,int cy,uint flags);

NOTE: If the popup recieves the focus at any time before the WS_POPUP style is removed, the currently focused form will not have the focus. However, once it gets the focus again after the WS_POPUP flag is removed, you can safely set focus to your popup without it losing the focus. So you have to remove that bit as early as possible in the form's creation.


"Blessed are the peacemakers, for they shall be called sons of God." - Jesus

"You must be the change you wish to see in the world." - Mahatma Gandhi







GeneralRe: SetWindowLong and SetWindowPos Pin
J. Dunlap15-Jun-03 13:35
J. Dunlap15-Jun-03 13:35 
GeneralRe: SetWindowLong and SetWindowPos Pin
J. Dunlap15-Jun-03 22:26
J. Dunlap15-Jun-03 22:26 
GeneralRe: SetWindowLong and SetWindowPos Pin
J. Dunlap16-Jun-03 8:02
J. Dunlap16-Jun-03 8:02 
GeneralRe: Showing a Form as a drop-down menu Pin
A.Wegierski15-Jun-03 22:54
A.Wegierski15-Jun-03 22:54 
GeneralRe: Showing a Form as a drop-down menu Pin
J. Dunlap16-Jun-03 7:47
J. Dunlap16-Jun-03 7:47 
GeneralArrayLists & multithreading... Pin
viperxp15-Jun-03 5:56
viperxp15-Jun-03 5:56 
GeneralRe: ArrayLists & multithreading... Pin
leppie15-Jun-03 6:44
leppie15-Jun-03 6:44 
GeneralRe: ArrayLists & multithreading... Pin
Arjan Einbu15-Jun-03 11:46
Arjan Einbu15-Jun-03 11:46 
GeneralRe: ArrayLists & multithreading... Pin
viperxp15-Jun-03 23:24
viperxp15-Jun-03 23:24 
GeneralRe: ArrayLists & multithreading... Pin
James T. Johnson16-Jun-03 0:10
James T. Johnson16-Jun-03 0:10 
GeneralRe: ArrayLists & multithreading... Pin
viperxp16-Jun-03 2:53
viperxp16-Jun-03 2:53 
GeneralRe: ArrayLists & multithreading... Pin
James T. Johnson16-Jun-03 3:13
James T. Johnson16-Jun-03 3:13 
GeneralRe: ArrayLists & multithreading... Pin
viperxp16-Jun-03 7:10
viperxp16-Jun-03 7:10 
QuestionSimple inheritance? Pin
mcgahanfl15-Jun-03 2:27
mcgahanfl15-Jun-03 2:27 
AnswerRe: Simple inheritance? Pin
leppie15-Jun-03 3:54
leppie15-Jun-03 3:54 
GeneralRe: Simple inheritance? Pin
mcgahanfl15-Jun-03 17:14
mcgahanfl15-Jun-03 17:14 
GeneralWeb service performance... Pin
Matt Gullett15-Jun-03 2:25
Matt Gullett15-Jun-03 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.