Im new to this forum so i hold this is the right place to post this.
I have to make a web browser in C# for a college assignment and i have to have a calculator in it. I have the web browser and calculator made but i want to use to different form classes for each one. Ive made the web browser as the main form(Form1) and then i added a new form into it(Cal). I added a button on Form1 and i want it th button to open the calculator when you click on it. Here is the problem,I cant figure out how to make the button show the calculator when you click on it. Ive initialized the calculator form in Form1 but I dont know what to doe next? Can anyone help?
Code for Form1:
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WebBrowser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Cal calculator = new Cal();
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode nName = e.Node;
string webPage = "";
webPage = (string)nName.Tag;
if (webPage != "")
{
webBrowser1.Navigate(webPage);
}
}
private void cal_Click(object sender, EventArgs e)
{
}
}
}
Code for Calculator form(Cal):
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WebBrowser
{
public partial class Cal : Form
{
public Form1 form;
public Cal()
{
InitializeComponent();
}
}
}
I have also added a image of the form, well hopefully if i did it right.
Thanks

New Topic/Question
Reply



MultiQuote




|