Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: Add product key to installation project Pin
Luc Pattyn28-May-10 2:07
sitebuilderLuc Pattyn28-May-10 2:07 
QuestionEvent for the release of a menu item Pin
manustone27-May-10 5:08
manustone27-May-10 5:08 
AnswerRe: Event for the release of a menu item Pin
Luc Pattyn27-May-10 5:32
sitebuilderLuc Pattyn27-May-10 5:32 
GeneralRe: Event for the release of a menu item Pin
manustone27-May-10 21:50
manustone27-May-10 21:50 
GeneralRe: Event for the release of a menu item Pin
Luc Pattyn28-May-10 2:00
sitebuilderLuc Pattyn28-May-10 2:00 
AnswerRe: Event for the release of a menu item Pin
Dr.Walt Fair, PE27-May-10 5:49
professionalDr.Walt Fair, PE27-May-10 5:49 
GeneralRe: Event for the release of a menu item Pin
manustone27-May-10 21:51
manustone27-May-10 21:51 
AnswerRe: Event for the release of a menu item Pin
William Winner27-May-10 6:16
William Winner27-May-10 6:16 
I'm a little confused.

You say
manustone wrote:
The point is that in doing this way ... the image includes also the open menu;


Then you say

manustone wrote:
I need to call the function right after the menu item gets close


If you take the screenshot right after the menu is closed, how will the screenshot have the menu opened? Which do you want? Do you want the screenshot with the menu open or without the menu?

If you want to include the menu in the screenshot, I would create the image during the MouseDown and then save it during the Item_Click like so:

C#
private Bitmap bmpScreenShot;
private Graphics gfxScreenShot;

private void takeScreenshotToolStripMenuItem_Click(object sender, EventArgs e)
{
    bmpScreenShot.Save(@"D:\temp\screenshot.png", System.Drawing.Imaging.ImageFormat.Png);
}

private void takeScreenshotToolStripMenuItem_MouseDown(object sender, MouseEventArgs e)
{
    bmpScreenShot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height,
                                      System.Drawing.Imaging.PixelFormat.Format32bppArgb);

    gfxScreenShot = Graphics.FromImage(bmpScreenShot);

    gfxScreenShot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0,
                                 Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
}


If, however, you're trying to do something after the menu is closed, you could handle its parents DropDownClosed event.
AnswerRe: Event for the release of a menu item Pin
AspDotNetDev27-May-10 13:19
protectorAspDotNetDev27-May-10 13:19 
QuestionDatabinding Pin
Mahdi_kishislan27-May-10 3:56
Mahdi_kishislan27-May-10 3:56 
AnswerRe: Databinding Pin
Henry Minute27-May-10 5:13
Henry Minute27-May-10 5:13 
AnswerRe: Databinding Pin
Ramkithepower27-May-10 5:17
Ramkithepower27-May-10 5:17 
Questionsorting Pin
Ramkithepower27-May-10 2:55
Ramkithepower27-May-10 2:55 
AnswerRe: sorting Pin
PIEBALDconsult27-May-10 2:59
mvePIEBALDconsult27-May-10 2:59 
AnswerRe: sorting Pin
rvdenden27-May-10 3:09
rvdenden27-May-10 3:09 
GeneralRe: sorting Pin
Simon P Stevens27-May-10 3:18
Simon P Stevens27-May-10 3:18 
AnswerRe: sorting Pin
Nuri Ismail27-May-10 3:11
Nuri Ismail27-May-10 3:11 
AnswerRe: sorting [modified] Pin
Simon P Stevens27-May-10 3:12
Simon P Stevens27-May-10 3:12 
GeneralRe: sorting Pin
PIEBALDconsult27-May-10 3:17
mvePIEBALDconsult27-May-10 3:17 
GeneralRe: sorting Pin
Simon P Stevens27-May-10 3:19
Simon P Stevens27-May-10 3:19 
GeneralRe: sorting Pin
PIEBALDconsult27-May-10 3:30
mvePIEBALDconsult27-May-10 3:30 
GeneralRe: sorting Pin
Simon P Stevens27-May-10 3:33
Simon P Stevens27-May-10 3:33 
GeneralRe: sorting Pin
Luc Pattyn27-May-10 3:38
sitebuilderLuc Pattyn27-May-10 3:38 
GeneralRe: sorting [modified] Pin
harold aptroot27-May-10 3:31
harold aptroot27-May-10 3:31 
GeneralRe: sorting Pin
Ramkithepower27-May-10 5:13
Ramkithepower27-May-10 5:13 

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.