Ok I am working on a project for my class. I have to make everything on one page, have a menu on the top. In the menu it is suppose to have new,open,From Html,save,and exit. I have all but the From HTML one done. I am kinda confused. with everything needed to be on one page when the user click the From HTML it show show a textbox and a button then you should be able to put in a web address and click go and the html code shows up in the richtextbox. Now the problem I am having is getting it all to word right. This is what I have so far..
private void button1_Click(object sender, EventArgs e)
{
WebRequest myRequest;
myRequest = WebRequest.Create("//");
WebResponse myResponse = myRequest.GetResponse();
Stream responseStream = myResponse.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
StringBuilder sb = new StringBuilder();
string line="";
while ((line = reader.ReadLine()) != null)
{
sb.Append(line);
sb.Append("\r\n");
}
richTextBox1.Text = sb.ToString();
}
as you can see this line has this
myRequest = WebRequest.Create("//");
being the fact I kind forget how to have it set to blank for the user to enter in there information. Or is there a way that when they click on From HTML that a messagebox can come up with the textbox and button but displays in the richTextBox?
I forgot to add this code
private void fromHTMLToolStripMenuItem_Click(object sender, EventArgs e)
{
}
This is where the messagebox should be a something with visible when the user click this button so it shows the textbox and button to display the HTML in the richtext area.
EDIT: I have a panel group which is called panel1. It has the button and the textbox for the user to enter in the URL that they want to. Know my question is when the peron clicks on From HTML I need to get the panel visible for only that one. So would I click on the panel and how would I only have it visible for only that one.
Since this is homework, I’m not going to give you the full answer, but here’s a place to start:
MessageBoxpresents the user with a message and lets him click a button in response, but you can’t add controls to it. Instead, you’ll have to define another form that contains your textbox and confirmation button, and open it in the handler forfromHTMLToolStripMenuItem_Click. You could set a property in that form to hold the user’s response (the desired URI), and retrieve it in the event handler when the form returns.