Hi,
I just started learning how to use Visual C# and I am having trouble creating a new web browser from a button. I currently have a button that I want to click to open a new web browser window, which will go to my homepage. I can't find anything on how to open a new window. The closest I have is webBrowser.NewWindow, but it doesn't seem to do anything. Any help is appreciated. Thanks
edit: wait wait, there's more! I also have a combobox and I want to be able to type in new items and have it add to the item collection. When I run it, the Item.Add in my program works and I can see the new additions in the combobox, but after I close the program and rerun it, the new additions are no longer there anymore. How do I save them Thanks again

new browser in C#
gpja
using
Microsoft.Win32; //Contains the Registry classRegistryKey pRegKey = Registry.CurrentUser;
pRegKey = pRegKey.CreateSubKey(@"software\MyProg");
int i = 0;
foreach (string s in cbo1.Items)
{
pRegKey.SetValue("item" + i, s);
i++;
}
You may need to put this in a Try block and so forth but this is the basic idea. To read the entries back and use them to repopulate your combobox you could do something like this:
RegistryKey pRegKey = Registry.CurrentUser;
pRegKey = pRegKey.OpenSubKey(@"software\MyProg");
for (int i = 0; i < pRegKey.ValueCount; i++)
{
cbo1.Items.Add(pRegKey.GetValue("item" + i));
}
Your data will show up in the registry like this:
\\HKEY_CURRENT_USER\Software\MyProg\item0
\\HKEY_CURRENT_USER\Software\MyProg\item1 ... etc.
Scraniel
Here is an attempt at launching an Internet Explorer window (>= IE4 only):
http://www.c-sharpcorner.com/Code/2002/Dec/IEInstance.asp
For your second question; I would probably store the collection in a database. What DBMS are you comfortable using
This is a decent article on C# data access:
http://www.devarticles.com/c/a/ADO.NET/Data-Access-in-.NET-using-C-sharp-Part-1/1/
Chad
Melissa_Janet
maybe this help you so:
System.Diagnostics.Process.Start(
"iexplore.exe", "http://www.msdn.com");it opens a ie and goes through the MSDN web site.
sincerely
Bidel.
TaffyDownUnder
C#
http://www.codeproject.com/csharp/webbrowser.asp
The sample is in VB, but explains the stuff well.
http://www.vbwm.com/articles/builder/viewer.asp ArticleID=31
Regards,
Vikram