Saturday, September 09, 2006 4:26 AM
Hi everyone, I was wondering how i can make a button connect to a form so when I click on it it takes me to that form but the form cannot be opened repeatedly.
Saturday, September 09, 2006 6:20 AM
code in the button click. (this is written in vb convert it to c#)
Dim objForms As Form
dim flag as boolean = false
For Each objForms In frmMDI.MdiChildren
If Not objForms.Tag Is Nothing ThenIf Convert.ToString(objForms.Tag).ToUpper = "XYZ" Then
flag = trueEnd If End If Next
if falg = false then
dim frm1 as Form1
frm1.Tag = "XYZ"
Saturday, September 09, 2006 8:25 AM
Can anyone kindly please do me a favour, please help me convert the above code to C#. Cos i am a mechanical engineering student with only basic C# background.
Many Thanks in advance.
Saturday, September 09, 2006 3:44 PMHi!
Just drop a button on the 1st form, add a second form to your solution and in the button click put:
private void button1_Click(object sender, EventArgs e)
Form2 f2 = new Form2();
Sunday, September 10, 2006 6:50 AMThanks alot lbc06 ur code works!!!