Post by ahmadamin on Apr 10, 2015 23:31:50 GMT 10
Please help to make proper Context Menu Strip list of Awesomium
|
|
Post by Nathan Lecompte on Apr 11, 2015 20:53:47 GMT 10
Hey ahmadamin , To make a context menu strip for the Awesomium browser you'll need to use the context menu strip that comes with it (should be visible in the toolbox as "AwesomiumContextMenuStrip"). Add that to your form and add functions like you usually do for any other normal context menu. Then when you've added it you'll need to connect it to your WebControl. In the properties of your WebControl, set the ContextMenu to the Awesomium one. I think this is how I did it last time, I might of missed something but try it and tell me how it goes... PS: Welcome to the forum!
|
|
Post by ahmadamin on Apr 12, 2015 22:49:06 GMT 10
Hey @nathan I know how to put Context Menu. But Help Me In Codes Like Open Link in New Tab Save Images Open Link In a New Window etc
|
|
Post by Nathan Lecompte on Apr 13, 2015 12:16:37 GMT 10
Oh, that! To get all the info (like the image and/or link that the user right-clicked on in this case) is all handled in the WebControl's ShowContextMenu sub. To show/hide button's when needed or not use something like this: Public ImageSaveURL As String '<<Put this outside of the ShowContextMenu sub If e.Info.MediaType = MediaType.Image Then ImageSaveURL = e.Info.SourceURL.ToString OpenImageInNewTabToolStripMenuItem.Visible = True Else OpenImageInNewTabToolStripMenuItem.Visible = False End If
'For opening links in new tab and/or window: Public NewTabLinkURL As String '<<Put this outside of the ShowContextMenu sub If WebControlLB.HasTargetURL Then NewTabLinkURL = e.Info.SourceURL.ToString OpenLinkInNewTabToolstripMenuItem.Visible = True OpenLinkInNewWindowToolstripMenuItem.Visible = True Else OpenLinkInNewTabToolstripMenuItem.Visible = False OpenLinkInNewWindowToolstripMenuItem.Visible = False End If
Then you'll need to make sure you code the items too of course, simply use the code you used to make a new tab and set the URL for it to either ImageSaveURL or NewTabLinkURL . Then for opening in a New Window simply use the code you used to open a new window and set the link to NewTabLinkURL as the start link for your window. Hope this helps! PS: Saving image is already an item in the ContextMenu
|
|
Post by ahmadamin on Apr 14, 2015 0:34:45 GMT 10
Thanks This One Is Helpful
|
|
Post by ahmadamin on Apr 15, 2015 0:24:13 GMT 10
I change the context menu Of Awesomium WebControl Then Debug The Project Context Menu is not showing after righ click. Please help
|
|
Post by ranilwallace on Jul 27, 2015 6:41:30 GMT 10
|
|