views:

289

answers:

2

Hi,

Am looking an option on how to add status bar and show the same for webbrowser control, any thoughts on that.

When i type sites with https: on a texbox above webbrowser i am supposed to show the ssl secure icon on status bar.

Please reply.

Thanks in advance, Karthick

A: 

You need to handle the StatusTextChanged event and check the StatusText property.

You can add a StatusStrip control and a StusStripLabel to your form, then set the StatusStripLabel's Text property to your WebBrowser's StatusText property in the StatusTextChanged event.

SLaks
Thanks for your help, but i can't find the statusTextchanged event for webbrowser, pls. help.
Karthick
Are you using the WinForms `WebBrowser` control or COM Interop?
SLaks
Winforms WebBrowser.
Karthick
The event does exist; you can see its documentation on MSDN by following the link in my answer. (http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.statustextchanged.aspx)
SLaks
Thanks again, but i am not able to create StatusTextChanged event, i used ProgressChanged event i toolStripStatusLabel1.Text = webBrowser.StatusText;But this show the text, but am supposed to show the SSL secure sign in symbol, please help. Thanks in advance.
Karthick
http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx demonstrates the steps required to handle unmanaged webbroweser events
Sheng Jiang 蒋晟
A: 

To show the padlock icon, handle the DocumentCompleted event and show the icon if browser.Url.Scheme == "https".

SLaks