Results 1 to 4 of 4

Thread: Help with Context Menu

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    178

    Help with Context Menu

    I've searched but unable to find what I am looking for.

    I want to change the default context menu with my own. That will only have a print option, I don't need any of the others.

    How do I go about doing that?


    Also, how do I change the header/footer?
    Last edited by TrickyNick; Nov 29th, 2010 at 07:17 AM.

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help with Context Menu

    Quote Originally Posted by TrickyNick View Post
    I've searched but unable to find what I am looking for.

    I want to change the default context menu with my own. That will only have a print option, I don't need any of the others.

    How do I go about doing that?


    Also, how do I change the header/footer?
    What type of control?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    178

    Re: Help with Context Menu

    Quote Originally Posted by kevininstructor View Post
    What type of control?
    Wow, I thought I put that in, I am sorry.

    It's a Webbrowser control.


    I've managed to disable it, but I would rather replace it to give the user the option to print, but only if I can figure out how to change the header/footer. Reason of rthat, is because when it prints, it says it's printing the URL "about:blank" since I am changing the text it doesn't change that.

  4. #4
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help with Context Menu

    Add a context menu to the form, create menu item(s), then assign the context menu to the webbrowser.

    Dismiss the WebBrowser's default context menu
    Code:
    WebBrowser1.IsWebBrowserContextMenuEnabled = False
    Code:
        Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
        Handles MyBase.Load
            WebBrowser1.AllowNavigation = True
            WebBrowser1.Navigate("http://www.google.com")
            WebBrowser1.IsWebBrowserContextMenuEnabled = False
        End Sub
        Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, _
                                                 ByVal e As System.EventArgs) _
                                                 Handles PrintToolStripMenuItem.Click
            MsgBox("Your print code goes here")
        End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width