Hello,
Im creating a Web Browser in Visual C# and I have a preferences dialog. The
current homepage is yahoo.com. The code for the homepage is:
// Go Home - go to the default home page.
WebBrowser thiswebpage = GetCurrentWebBr owser();
thiswebpage.Nav igate("http://www.yahoo.com") ;
On the preferences dialog I have a section to change the homepage. In that
section I have a text box and a button. The Preferences Dialog is a seperate
window. What code should I add to the button so that the homepage changes to
the website I typed in the text box when the button is clicked?
Thank You,
Matt
Nov 16 '05
13 2260
Hi Cor,
Thanks, but just on problem:
Now C# only underlines: axWebBrowser1 with the color blue.
When I build it the error output says:
Error 1 'WEB.Preference s' does not contain a definition for 'axWebBrowser1'
C:\Documents and Settings\Admini strator\Desktop \Web Browser\Prefere nces.cs.
We're getting closer :)
Thanks,
Matt
"Nick Malik [Microsoft]" wrote: OK.
In your main form, create a public method. The idea is that any other part of the system can call your main form and provide a URL, and your main form will respond by bringing up that URL in the window.
Also, I've included the code needed to pass the reference to the preferences form.
public class MainForm : System.Windows. Forms.Form { private Form m_preferences = null;
public void SetURL(string myURL) { // put code here to cause your browser app to visit the URL and render
}
public void DisplayPreferen cesDialog() { m_preferences = new frmPreferences( ); // create the preferences object m_preferences.B rowserWindow = this; m_preferences.S how();
}
}
Your preferences window gets one new property and a new method.
public class frmPreferences : System.Windows. Forms.Form { private MainForm _browserwindow = null;
public MainForm BrowserWindow { set { _browserwindow = value; } }
// now, call this little method from within your form code to set the URL on the browser window private void SetBrowserWindo wURL(string URL) { _browserwindow. SetURL(URL); } }
I hope this helps. -- --- Nick Malik [Microsoft] MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not representative of my employer. I do not answer questions on behalf of my employer. I'm just a programmer helping programmers. -- "Matt" <Ma**@discussio ns.microsoft.co m> wrote in message news:97******** *************** ***********@mic rosoft.com... Hello,
Thanks for the help but Im just starting and learning to program in Visual C#. Can you please repeat the instructions in more detail?
Thank You,
Matt
"Nick Malik [Microsoft]" wrote:
when you create the preferences dialog, pass in a reference to the browser object where you have the URL property. WHen the user clicks the button, assign the new URL to this browser object.
-- --- Nick Malik [Microsoft] MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not representative of my employer. I do not answer questions on behalf of my employer. I'm just a programmer helping programmers. -- "Matt" <Ma**@discussio ns.microsoft.co m> wrote in message news:61******** *************** ***********@mic rosoft.com... > Hello, > > Im creating a Web Browser in Visual C# and I have a preferences dialog. The > current homepage is yahoo.com. The code for the homepage is: > > // Go Home - go to the default home page. > WebBrowser thiswebpage = GetCurrentWebBr owser(); > thiswebpage.Nav igate("http://www.yahoo.com") ; > > On the preferences dialog I have a section to change the homepage. In that > section I have a text box and a button. The Preferences Dialog is a seperate > window. What code should I add to the button so that the homepage changes to > the website I typed in the text box when the button is clicked? > > Thank You, > > Matt
Same Error???
"Cor Ligthert" wrote: thiswebpage.
Matt,
I thought it was a solution, however this is about the favorite window in
IE. So before we are looking for a solution too get it working. Is that what
you are after? I could not find what was the preferences dialog so I thought
it was this one.
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Adam J. Schaff |
last post by:
OK, there are billions of posts on dotnet newsgroups about this, and I have
read half of them, but I'm still a little confused. First I'll say what I
think I've learned and anyone can correct me if I'm off target.
1. User preferences should be saved to the UserAppDataPath.
2. They should be saved as an XML file.
3. Serialization is a handy technology for going about this, since you can
simply store all your preferences in an object and...
|
by: Jonathan |
last post by:
Hi,
Here's an interesting challenge for anyone who's up to it. :-)
When I edit preferences for Netscape or Mozilla, there's an option
that says "block unrequested popup windows." Next to this is a button
that says "Allowed Sites." Presumably, the idea is that if you have a
serious web application that needs to open new browser windows, you
might want to tell your clients to add you to the "Allowed Sites."
Well...when I look at the...
|
by: Just Me |
last post by:
If I look at the properties of a printer I can find two things:
Printing Preferences and Printing Defaults.
I believe the preferences apply to my apps and the defaults apply to all
users.
In a dotnet app:
Which does the DefaultPageSetting relate to?
|
by: clintonG |
last post by:
I'm messing around with the Request.UserLanguages and the
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"); to see
how similar or dissimilar they may be.
I observe and conclude that both get their value from the Accept-Language
key stored in the header of the response. To test this hypothesis I
reconfigure IE Language Preferences which by default (for me)
is English (United States).
I include a Spanish (Mexico) Language Preference and
|
by: Tom |
last post by:
I am planning on adding a Preferences form to my application and using the
Property Grid to display the preferences to the user. What do you think
would be the best way to save these preferences out to an XML file? Use the
CAB (Configuration Application Block)? Save the preferences in a class
object and serialize them out the the XML file? Write them out directly to
the XML file? Other ways???
Just want to get some thoughts together......
| |
by: Tom |
last post by:
I am planning on adding a Preferences form to my application and using the
Property Grid to display the preferences to the user. What do you think
would be the best way to save these preferences out to an XML file? Use the
CAB (Configuration Application Block)? Save the preferences in a class
object and serialize them out the the XML file? Write them out directly to
the XML file? Other ways???
Just want to get some thoughts together......
|
by: Tom |
last post by:
I have a large application; lots of forms, multiple dynamic DLLs, etc. I
also have, in the appliation, a general 'Preferences' class object (which is
in itself a separate DLL, and I just include a reference to it so I can
instantiate it at the beginning) which stores all my user preferences. I
serialize the data to and from an XML file, thereby saving and restoring the
user preferences with ease. I also have a Preferences form that the user...
|
by: H. Williams |
last post by:
I am trying to programmatically change printing preferences (not printer
settings). For example, preferences specific to a printer like watermark or
pages per sheet. I have tried using the PrintDocument.PrinterSettings
class, but it only exposes the basic printer settings. I have been able to
use SystemManagement.ManagementObject.Properties to expose additional
printer settings, but I can't seem to find the preferences. Anyone know how...
|
by: =?Utf-8?B?T21lZ2FTcXVhcmVk?= |
last post by:
have customized PageSetup and Print dialogs that emulate the standard
dialogs. I would like to be able to open the "Printer Preferences" dialog by
clicking a button (just like can be done on the standard dialogs).
(On some Print dialogs (such as in Word and Excel) this button is labelled
"Properties". And just to avoid being too consistent, it is labelled
"Options" on the Excel PageSetup dialog.)
I thought that this would be trivial,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |