Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 13th, 2005, 12:18 PM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple 'passing variables between forms' issue...

I'm reasonably new to c# programming and I have a issue which seems like it should be fairly easy to solve, however, I'm getting that 'cant see the wood for the tree's' feeling so hopefully someone can help me here...

I have a simple MDI application that has an 'outlook' style bar on one form and a web control (axWebControl) on another form. What I want to do is pass a URL to the web control when I click an icon on the outlook bar. Problem being that I'm not sure how to pass a variable to the instance the current axWebControl. Can anyone help?

I'm sure I'm missing something obvious and will kick myself when I hear the answer. :)

Reply With Quote
  #2 (permalink)  
Old October 13th, 2005, 04:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can't you just assign the URL to a property of the web control? i.e. make your own property and then assign it to the current instance of the control.

Jacob.
Reply With Quote
  #3 (permalink)  
Old October 14th, 2005, 09:13 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the response Jacob but I'm still having a problem. Here's a better example of where I'm going wrong. I have an MDI application with three forms:-

MDIMain.cs
Browser.cs - (Contains the axWebBrowser object)
ButtonsForm.cs

axWebBrowser is instanciated in the Browser.cs form. Browser.cs also includes this public function:-

public void redirectWeb(string sUrl)
{
try
{
    axWebBrowser1.Visible = true;
    axWebBrowser1.BringToFront();
    System.Object nullObject = 0;
    System.Object nullObjStr = "";
    Cursor.Current = Cursors.WaitCursor;
    axWebBrowser1.Focus();
    axWebBrowser1.Navigate(sUrl, ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);
    Cursor.Current = Cursors.Default;
}
catch(Exception exc)
{
    MessageBox.Show(exc.Message);
}
}

When I press a button on the ButtonPanel.cs form I would like it to pass a new URL to the current instance of the axWebBrowser control but I'm not sure how to do this. I can get the application to create a new instance of the Browser.cs form each time I click a button but that is not what I want - I need to pass the URL to the [u]current</u> instance of the axWebBrowser.

I'm probably approaching this completely wrong but I need guidance.

Many thanks,

Phil
Reply With Quote
  #4 (permalink)  
Old October 14th, 2005, 11:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is hard to know what you mean since the terms and concepts used in the description are confusing; e.g. you are talking about files, eventhough it is irrelevant (you probably mean classes). Moreover, axWebBrowser is not a class but an instance of some class, as far as I can see!

In my first post I missed the fact that it was a MDI application. I am not quite sure how to do it. Sorry.

Jacob.
Reply With Quote
  #5 (permalink)  
Old October 14th, 2005, 02:30 PM
Registered User
 
Join Date: Oct 2005
Location: Mitrovica, Kosova, Yugoslavia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all hello,maybe this is not right pleace where i can look for help,but thank you in forward who can help me to build a helpfile AVi files for an application.THANKS AGAIN

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms - This should be simple. gargamel BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 April 10th, 2007 09:16 AM
Passing variables between forms arcuza General .NET 1 July 11th, 2005 09:08 AM
Newbie...probably a simple question...variables IP076 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 November 30th, 2004 03:24 PM
Forms and variables Dai Beginning PHP 4 June 19th, 2003 02:25 PM



All times are GMT -4. The time now is 12:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.