.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Context Menu And Mouse Click Issue

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :WPF
 
Hello. I am trying to show a context menu at runtime on MouseRightButtonUp, while over a selected image. I also have left mouse button events set up for the selected image. For some reason I cannot get the context menu to show unless I click the left mouse button and while it is held down click the right mouse button and keep it down while I release the left mouse button, followed by releasing the right mouse button. I tested the MouseRightButtonUp event using a simple MessageBox and did not have any problems; it worked as expected when the right mouse button was released. Here is the code: //add behavior for right mouse on this image. img.MouseRightButtonUp += (sender, e) => { //Create Context Menu ContextMenu menu = new ContextMenu(); //img is an Image img.ContextMenu = menu; //Add context menu item MenuItem photoNewWindow = new MenuItem(); photoNewWindow.Header = "Open Original Image"; photoNewWindow.Click += OpenOriginal; //Add menu items to context menu menu.Items.Add(photoNewWindow); //change the current image currentImage = img; }; // add behavior for mouse click on this image. img.MouseLeftButtonUp += (sender, e) => { // left mouse stuff }; Thanks! 


View Complete Post


More Related Resource Links

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010

  

Hi,


I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPFile page = web.RootFolder.Files["Defaul

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010

  
Hi,


I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPFile page = web.RootFolder.Files["Default.aspx"

Context Menu not listing all fields issue with ie7

  

Hi,

We have a Sharepoint 2007 installation using performance point reporting for our main system. Because of legacy systems our endusers are using IE6 and all works correctly. Recently we have moved some end user browsers to IE7 and this has had an effect on our reports.

In IE6 we can drilldown using the context menu in Analytic  graphs and Analytic datagrids, which displays all of the fields that are part of the cube. If most cases it displays about 20 fields that can be used to slice the information as we require it.  Using IE7 we can still drill down but the list of fields displayed is much shorter, usually 4 or 5. 

Is there a setting or fix we need to apply to IE7 to display the full list of fields in the context menu?

 


How to get Context Menu when i right click on GridView Column

  

Hi....

When i right click on Gridview Column,Context Menu will be displayed.

When i click any of them in context menu it will display new aspx page.

Is it Possible w/o Java script?

Plz help me in that....I struck at that.


Thanks,

Rama krishna.


How to Context Menu when i right click on Gridview selected Row using Jquery

  

Hi,

I have a requirement that

When i select a row in Gridview,it will High light the row and when Right click on selected

Row,It will open Context Menu.

In that menu i want to do Add new row delete row etc.


Help me in that.

Thanks,

Rama krishna.



intellisense and context sensitive menu option issue.

  

 This is probably the wrong forum for this but I can not seem to find a more appropriate forum. I am having an issue that no amount of googling can seem to solve... I am a long time developer in vs2003-vs2005 and have recently migrated to 2008 for a personal project.

 I am having an annoying issue where occasionally, specific class files loose the functionality of intellisense and some context sensitive menu options (Refactor and Find All References for example, go to definition is visible but disabled) for no apparent reason and without any identifiable change to the systems configuration. This issue does not occur in every file, and occurs at some point after a file is created. if the file is deleted and  then recreated the issue is temporarily resolved, unless the original code is pasted back in. Restarting visual studio does not resolve the issue. Resetting options in Tools>Options>Text Editor does not resolve the issue.

 I have included a screenshot of the menu issue.

a wierd issue

 

Does anyone have a clue on what is going on? Or how to resolve it?


Cutting Edge: Adding a Context Menu to ASP.NET Controls

  

Although the context menu is a common element of most desktop applications, it is still fairly uncommon in Web application names because it doesn't map well to a server-based technology like ASP. NET.

Dino Esposito

MSDN Magazine February 2005


Menu control rendering issue with IE8

  

Hi

Using VS2010, I created an ASP.NET 4.0 web application and simply added a couple of menu items below the "Home" menu item in the master page that's created by the project wizard. I made no other changes - no code, no stylesheet changes.

If I run the app locally then everything is fine. I suspect because the local IIS is responsive enough for the problem not to occur.

If I deploy the app to a web host (discountasp.net) then I see the menu render vertically for less than a second before it renders correctly. If I refresh the page a few times then usually I can see the menu vertical flash but sometimes I can't, so there's some sort of timing consideration.

I'm using IE8. The problem doesn't seem to occur with either Firefox 3 or Chrome.

Have others seen this problem?

Any suggestions for a fix?

I can supply the zipped up project if anyone wants it.

Thanks


JQuery accordion menu issue!!!

  
Hi,I have added this accordion menu in the master page of an asp.net(C#) website. http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm?expandable=4&subexpandable=0It works fine in those content page which are in the root folder but it is continously showing error in Administration page and the error is ddaccordion is not defined [Break on this error] ddaccordion.init({ //top level headers initialization Can anybody let me know why it is giving this error?Any help will be really appreciated !!!Regards,Dazy

Remove action that appear in the menu which appears when we right click each individual item in libr

  
i need to remove or hide edit properties menu from  menu which appears when we right click each individual item in library 

Menu Control expansion weired issue.

  
Menu control expands on load (vertically, 100%) and then contracts to its horizontal position. The code I am using- ASPX page: <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal" DataSourceID="SiteMapDataSource1">                    <DynamicMenuStyle CssClass="DynamicMenu" /></asp:Menu>   CSS:  .DynamicMenu{ display: none;} This can be live at www.jaindata.com Can someone please help? Thanks, Swapneel Shah 

Menu render issue with itemwrap

  
HiI have the following asp menu:        <asp:Menu runat="server" ItemWrap="true"            Width="200" RenderingMode="Table"             StaticDisplayLevels="3">            <Items>                <asp:MenuItem Text="Mainmenu">                    <asp:MenuItem Text="Submenu that is too long to fit onto a single line"></asp:MenuItem>                </asp:MenuItem>            </Items>        </asp:Menu>How can i fix that the second line of the submenu has the same margin as the first line?I'd really appreciate your help.Philipp

The OTHER Menu control issue...

  
Ok, everyone knows that the z-index is messed up in IE8 and that requires patches or workarounds...What I can't seem to find a solution to is the white background on the DynamicMenu parts of a Menu control.  Setting the background color to transparent or not setting it all doesn't seem to have any effect.  This is only a problem in IE8, Firefox 3.6.8 renders the dynamic menus without the white background.

mouse click event

  
there are many control lack this mouseclick event, though they have the mousedoubleclick. in this scenario: i click on obj1, holding the click, move it to obj2 and release the click you see here obj1 is mouse-down, but mouse-up is obj2 so, do you count there's a mouse click event happened here? if you count it, which object will you consider should receive the mouse click? or is there a better way/algorithm to handle this mouse click? in my view, there's no mouse click happen, unless the down and up are happened on same obj.

How to add an action to SiteManager's context menu?

  
How can I add an action to the context menu in "Manage Content and Structure" (sitemanager.aspx)?  I would like to be able to add a "Edit Page" action to the drop-down of pages. We have pages that contain a redirect web part, which redirects the page on load.  We need a way to get into Edit mode to change the redirect URL. Please tell me how I can do this.  Thanks.

Open ContextMenuStrip on left mouse click on NotifyIcon

  
Hi,I was working with an application and faced this problem, I have this code :public partial class Form2 : Form    {        public Form2()        {            InitializeComponent();        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button == MouseButtons.Left)            {                contextMenuStrip1.Show(this, Control.MousePosition); // Or any other overload            }        }        private void Form2_Load(object sender, EventArgs e)        {            notifyIcon1.Icon = Icon;        }    }Here, in design mode, i have set contextMenuStrip1 as notifyIcon1's ContextMenuStrip. When I right click on notifyIcon1, it opens the context menu and when I click somewhere else, it closes. But with my code opens the contextmenu on left click and when I open context menu that way, it shows in taskbar and doesn't close when I click some where else.In short, I want to open contextmenustrip when user left clicks and right clicks on the notifyicon and it works well with right click by default but not with left click. And I want to avoid using SendMessage to send left click message.Is there any way I can work this out?

Implement Mouse Click event in AxShockWaveFlash

  
Hi, I want to hide the AxShockWaveFlash control when I clck on it. public class myAxShockwaveFlash: AxShockwaveFlashObjects.AxShockwaveFlash { private const int WM_LBUTTONDOWN = 0x0201; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_LBUTTONDOWN: { Visible = false; // I also tried SetVisibleCore(false); } break; } base.WndProc(ref m); } } There are no errors while debugging. Unfortunatelly the AxShockWaveFlash doesn't disappear. If I use methods instead that are defined direct in AxShockWaveFlash (like Play(), Stop(),...), the source code will work. Why does it not work?
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend