In this lecture we are going to add some finishing touches to the web browser.
A web browser is technically working but we just want to add some extra features to make it look a bit
more polished.
We are going to have things like a context menu.
We are going to update the title bar.
We're also going to enable all to completion.
So let's add a context menu.
So open up your tool box and go to menu on toolbars and there should be one for context menu.
Just just double click on the context menu strip and from high that dash.
That's the context menu that context menus only appear when you right click on something but in C shop
with individual studio will show you your context meaning as if there where a main menu so that you
can edit it more easily.
So we already added a context menu.
So what you need to do is choose your web browser component which is this one.
Make sure it shows as web browser here in the properties pay and what we're going to do with for the
properties for the web browser.
We are going to change this context menu strip currently saying no we're going to change it to the context
menu we've just added.
So if I click on the dropdown.
This is what we just added our change it to context menu strip one another property likely change is
this one here is called E's web browser contexts.
Currently it's set to true.
Change it to force.
What that does it.
It disables the default context menu for the web browser so that your new one the one you just added
is used instead
at the moment when you your web the title bar for the page always sticks to the name of your web browser
for example each you should say blue line.
When the Web page loads but we are going to change that so that it will automatically update to include
the title from the web page that is currently loaded.
All right.
So to do that we need to change something in the event list for the web browser.
So click on the web browser here and click on event.
This little bold here and you should see this here that says document complete it so double click on
that.
And that will give us a Skeletor code.
So this is the event handler for this event.
So we're going to write some piece of code that will help update the title when that is clicked.
All right let right write some code to control that so time start with a text
followed by we'll going to said that two equals to the name of your browser.
In my case my blue line.
OK.
So after you said the text recourse to the name of your web browser they put a dash and because this
is a tax you need surrounded wheat quotes it's a string.
Then after that you put a plus sign which is concatenate you use plus concatenate concatenation means
when you add together and then followed by the name of the web browser.
Dot the document
and then the title
then you put a semicolon
the text refers to the text property of the window so that line of code is line of code here will update
the window title bar to read the this name of the browser which is blue line here followed by the title
of the document that just got loaded so it appends it this using this plus sign it adds it together.
The last thing we are going to do for this lecture is to enable or to completion auto completion is
commonly used in Web browsers to show a list of recently visited Web sites.
So as the user types in that domain for example if you're typing maybe WWL Google dot com in the location
bar you would be shown a list of Web sites that start in on that start with that name.
OK that you have visited recently.
So this is easy to set up so let's go back to our design view and click on the combo.
Make sure you've got your combo box selected and there is a property that's an ode to completion complete
source property.
Let's look for that.
So there's a property for the combo box called or two complete source.
Currently it is set to None.
Just click on that and change it and set it to all you RL.
Okay so that should be say your work.
And let's test the application to stop browser click on Start
All right.
So less time paying of Web sites.
How typing w w w dot that's 2 B B C dot com and click on Go
is noted.
You see that it is added the BBC website to the name of our web browser.
So the title has changed.
Notice that the so list is here.
So our page is working as designed.
All right.
And you can see if we go to BBC again this combo box will be populated to all the Web sites.
You virtually visit.
It will have the list.
So you want wanted to go for BBC again.
It just gives me a list.
Excellent.
So let's try.
Let's try something else.
Let's try a b c.
Dot com
so this is ABC website.
Notice this is added the title to the name of my browser.
So yeah the Maya web browser is working as designed.
Excellent.
Thank you so much for your time.
I hope it has been useful.
You can tweak it more if you wish.
There's always room for improvement.
Thanks for watching.
Take care.
All the best.
Bye for now.