Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

By Right-click displaying context menu on map

This is a discussion on By Right-click displaying context menu on map within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi Wilfried, I need to update myself with VS2005 . On map's right-click event I can make it to show ...

  1. #11
    Banu is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    Hi Wilfried,

    I need to update myself with VS2005 . On map's right-click event I can make it to show a messagebox or any modal window by starting new thread. But ContextMenu does not show up. On the same thread it does not paint itself properly, but can see its boundary. Showing it on new thread does not do anything.

    Thanks for bearing with me and for your great help.

  2. #12
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    You cannot show a message box in another thread. You have to show it in the same thread context of the main GUI thread.

    Be very carefull with thread in dotNet !!!

  3. #13
    Banu is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    Hi Wilfried,

    It's working now. Thanks for helping me.

  4. #14
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  5. #15
    skylord5816 is offline Junior Member White Belt
    Join Date
    Oct 2007
    Posts
    3

    Question Re: By Right-click displaying context menu on map

    How do you prevent the popping up of the context menu on your site and make an alert box if anybody rightclicks anywhere on the document in plain old HTML? I have tried onRightClick, and onContextMenu. The box comes up, but it doesn't stop the context window from coming up. Please help soon.

  6. #16
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: By Right-click displaying context menu on map

    Hi,

    Do you mean with the MP control ? There is a parameter Cancel that can be set to true. About HTML you cannot, you need to use JavaScript.

  7. #17
    skylord5816 is offline Junior Member White Belt
    Join Date
    Oct 2007
    Posts
    3

    Question Re: By Right-click displaying context menu on map

    Can you use JS w/ HTML??? I tried, and it worked. Some JS scripts I tried on HTML:
    <html>
    <title>
    Scripting
    </title>
    <body>
    <fieldset>
    <legend>
    Scripts
    </legend>
    <BODY onContextMenu="javascript:alert(...')">
    <BODY onLoad="javascript:alert(...')">
    <A NAME="top">Welcome to the Top!
    <A HREF="#nbop">Click here to go back!</A><br>(2nd time through)<br>
    </HEAD>
    <BODY BGCOLOR="FFFFFF" TEXT="000000" LINK="0000FF" VLINK="800080" ALINK="FF0000">
    <P>&nbsp;<P><P>&nbsp;<P>
    <br><br><br><br><br><br><br>
    <CENTER>
    <FONT SIZE="+2"><A HREF=""onMouseOver="document.bgColor='black'">Blac k</a>
    <A HREF=""onMouseOver="document.bgColor='green'">Gree n</a>
    <A HREF=""onMouseOver="document.bgColor='yellow'">Yel low</a>
    <A HREF=""onMouseOver="document.bgColor='red'">Red</a>
    <A HREF=""onMouseOver="document.bgColor='brown'">Brow n</a>
    <A HREF=""onMouseOver="document.bgColor='white'">Whit e</a>
    </FONT></CENTER><br>Color onMouseOver<br>
    <A HREF="..." onMouseOver="window.status=
    ...'; return true">Club Penguin</A>.<br>
    <A HREF="..." onMouseOver="window.status='...'; return true" onMouseOut="window.status=
    '...'; return true">Runescape</A><br>
    <A HREF="..."
    onMouseOver="parent.location=...";>Dude!</A>o<br>
    <A HREF="..."
    onMouseOver="alert('...')";>...</A><br>
    <A HREF="..."
    onClick="alert('...')";>...</A><br>
    <FORM>
    <INPUT TYPE="button" VALUE="BACK"
    onClick="history.go(-1)">
    <INPUT TYPE="button" VALUE="FORWARD"
    onClick="history.go(1)">
    </FORM>OnClick FormBut. Hist<br>
    <FORM>
    <INPUT TYPE="button"
    VALUE="Click To Go To the Bottom Of The Page"
    onClick="parent.location='#code'">
    </FORM>WIpagel<br>
    <FORM>
    <INPUT TYPE="button" VALUE="Click Here to Write to Me"
    onClick="parent.location='mailto:...'">
    </FORM>Mailto<br>
    <A NAME="nbop">
    <A HREF="#top">Top of Page onClick</A><br>
    </fieldset>
    <A NAME="code">
    </body>
    </html>

    Of course I used different things instead of ellipses dots.
    But can you show me how to altogether eliminate the context bar and display an alert??? This one shows the alert, but doesn't block the context menu (the code for the context menu is near the top).
    This is HTML, and the site I learned if off of told me it was also JS. What is going on??? I am just getting into coding, but I am ambitious and want to learn everything. I am working on scripting for now.
    Can you give me an example for blocking the context message?
    What does MP control mean??? And whats a parameter cancel???

  8. #18
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: By Right-click displaying context menu on map

    Hi,

    I'm not sure I understand the problem. Also please put code into [ code ] tags then it is displayed with the right indent for better readability. Do you display the map, so how? This code does not show enough unless I'm not looking well.

  9. #19
    skylord5816 is offline Junior Member White Belt
    Join Date
    Oct 2007
    Posts
    3

    Question Re: By Right-click displaying context menu on map

    The other stuff is all other stuff. The only thing that I'm asking about is the <BODY onContextMenu="javascript:alert(...')"> line. It says when you rightclick (or context menu) anywhere in the BODY, it will alert you saying whatever is in the parenthesis. It will display the alert, but still allow the context menu. How do you block the context menu AND display an alert??? And as for the code tags, what are they???

  10. #20
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: By Right-click displaying context menu on map

    Hi,

    What does MP control mean??? And whats a parameter cancel
    I think you use mappoint webservice right ? This forum is for the mappoint desktop version and also for using it embedded in a custom application. There is another forum for the webservice and virtual earth here also.

    For the contextmenu you mean the one generated by the browser? You can prevent this for some browsers but not for all. For IE you find an article at msdn: Adding Entries to the Standard Context Menu but this will not work with other browsers. Operan and Firefox will display it. I don't think you can even block this with Firefox. And there are a lots other browsers too included custom made that you can't prevent anything.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disable Context menu
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 12-23-2008, 01:05 PM
  2. Click events of context menu are not firing....
    By Learner in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 05-12-2008, 03:33 PM
  3. Custom context menu
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-10-2004, 11:15 PM
  4. Extending MapPoint - How about the Context Menu Enhancements
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-10-2004, 10:38 AM
  5. VB.NET & overriding the map point context menu...
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-05-2002, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36