|
Try this:
webBrowser1.Url = new Uri("http://www.microsoft.com");
|
|
|
|
|
I tried the above code, but nothing is displayed....Help!
Is there any mistake with this code:
webBrowser1.Url=new Uri("http://www.microsoft.com");
|
|
|
|
|
i'm sure ,you are making mistake in some place.
Because i tried that and its working fine..
But if you don't want to change URL dynamically,then try to set URL property of web_browser1 to
http://www.microsoft.com..
|
|
|
|
|
The DocumentCompleted event occurs after a webpage loading is completed by the WebBrowser control. So no matter if you use Webbrowser1.Url of WebBrowser1.Navigate() it will not work in this event.
Instead use
webBrowser1.Url = new System.Uri("http://www.google.com", System.UriKind.Absolute); in your pageload or in init.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
uphh!! why 1 ??
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Hi,
thanx for your help Spunky.... I was successful in building the project. Thanx once again!
|
|
|
|
|
Will I place the code in Button1_Click event handler or WebBrower1_documentCompleted event handler?
|
|
|
|
|
The DocumentCompleted event signals that a page has loaded (or thereabouts - the actual timing seems a little odd). It occurs after you have connected to Microsoft.com. In order to actually connect, you need to call webBrowser1.Navigate(@"http://www.microsoft.com")
|
|
|
|
|
Hi,
Please tell me where should I insert following codes:
webBrowser1.Navigate(@"http://www.microsoft.com");
OR
webBrowser1.Url = new System.Uri("http://www.google.com", System.UriKind.Absolute);
will I have to enter the following code in the Button1_Click Event handler or WebBrowser1_DocumentCompleted event handler?
Please Help....
Rajdeep.NET
|
|
|
|
|
Read the replies you have been given. You are putting the code in the wrong event. Read the name of the event. Does it make sense to navigate to a page in the document_completed event?
Think about what you are doing and READ THE REPLIES YOU HAVE ALREADY BEEN GIVEN
|
|
|
|
|
Yeah, I was writing the code in a wrong event. Thanx for correcting me!
Happy Programming to all of you....
Thanx again, from my heart!
Rajdeep.NET
|
|
|
|
|
Hi,
How to assign font size?
eg:
Font ft;
ft=15; // this show error
Thankyou
YPKI
|
|
|
|
|
ft = new Font(ft.FontFamily, 15);
This assumes that ft is initialised and not null. If ft is null, then specify another argument (like the font name) instead of ft.FontFamily. If you do end up with this, don't forget to put the font name in double quotes, like this:
ft = new Font("Arial", 15);
|
|
|
|
|
Good People,
I have attempted to use File.Copy to copy from a source file to a new file. However, even after I get the apps running directory (usine AppDomain.CurrentDomain.BaseDirectory + @"UserImages\") it still does not work. It throws an exception claiming it can't find part of the directory of the destination file. What I don't understand is that using AppDomain.CurrentDomain.BaseDirectory + @"Database\AppDatabase.vdb3" to find my database for the application works as expected.
Do I have to create the new file first before writing to it? Doesn't File.Copy create the new file? Any ideas?
Thanks,
Blitz
|
|
|
|
|
Hi,
Windows does not create the directory if it does not already exist.
Windows Explorer will create directories for you, the programming interfaces don't.
So you have to take care of that yourself using Directory.CreateDirectory.
BTW: there is no need to test, creating a directory that already exists is harmless.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks for your reply.
The directory exists, but the file doesn't. Do I need to create the file? The examples in msdn didn't indicate I need to create the file. Plus, how would I create an empty jpg file?
Thanks again.
Blitz
|
|
|
|
|
You'd better make sure the destination directory exist while coping file.Hope such code can help:
string strPath = AppDomain.CurrentDomain.BaseDirectory + @"UserImages\";
if(!Directory.Exists(strPath))
Directory.CreateDirectory(strPath);
Regards,
Dealon
Impossible is nothing!
|
|
|
|
|
Instead of concatenating the path variable together, use System.IO.Path.Combine. That will automatically handle the backslashes. For your problem: as the other replies have stated, the path to the destination folder doesn't exist. You need to create it
|
|
|
|
|
Thank you for all of your replies.
What I don't understand, however, is that the folder does exist. In fact, the path it shows as not being able to find is, in fact, the correct path to the folder. I need it to place the new file in the folder - which already exists. So the directory already exists.
I apologize for my confusion, but what am I missing?
Thanks,
Blitz
|
|
|
|
|
OMG!!! You all are so right! Thanks. Indeed, it did not exist. See, my error was that I added the "UserImages" folder to my project. However, it was not in my output directory. I failed to realize the difference. Now I know, and knowing is half the battle
Thanks so much for your help.
|
|
|
|
|
Hi
I have added 10 items to ListView control.When i click on the items of listview control it should be added to the column of the TableLayoutPanel.How can i do this?
|
|
|
|
|
I think you'd better create a control(label, textbox,etc..)first associated with that item you clicked, then add to it to your TableLayoutPanel's controls.
Hope can help you.
Regards,
Dealon
Impossible is nothing!
|
|
|
|
|
Hi,
I have two date time picker i want to do as when i increase only the year in the DateTimeOicker 1 Then year of the DateTimeOicker 2 automatically increase for doing this what should i do,
Thanks
Sajjad Ali
|
|
|
|
|
Create an event for the change in DateTimePicker 1. In that event, increment DateTimePicker 2.
|
|
|
|
|
For exemple, i have a string = "%alan#23%12:34:50#ab %regular#]r";
Extract string which enclosed by '%' and '#'
The substring result should be
substr[0] = "alan";<br />
substr[1] = "12:34:50";<br />
substr[2] = "regular";
How to do it in Regex?
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|