Hello All :)
I Need Help
I have a problem when running a MainForm (1) from login(2) form ( With Button show MainForm ) I have a show More error because The Class SeleniumControl.cs Call MainForm (1) by : Program.MainForm.btnLogin ..... Or Other
Program = startup object
My class Program Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using System.Data;
using System.Drawing;
using System.Text;
namespace MyTools
{
static class Program
{
public static democs democs;
public static MainForm MainForm;
public static LoadingForm loadingForm;
public static gpaly gpaly;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
login= new login();
login= new login();
Application.Run(login);
}
}
}
Login Code
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 MYTools
{
public partial class login: Form
{
public login()
{
InitializeComponent();
this.IsMdiContainer = true;
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
short! when you open the form(1) from login form before him Gets problem I, for example, I need to work Button When Click The Button open MainForm With The Class SeleniumControl.cs ! Or Any Help !
When using
Form = new Form();
in
In Program.cs
The project works successfully, but shows,Problems or problems in different example of what line In My class
if (Program.form.dgGroups.RowCount == 0) await getGrps();
Object reference not set to an instance of an object.
Error : {MYTools.SeleniumControl} .......
did not sleep and I feel very tired because of this problem
Please Help Me
Thanks All
But I've Capture desktop video until the problem appear clearly and I hope you can watch the video and find a solution if possible
And apologized for any inconvenience
https://www.youtube.com/watch?v=683o_xwQ-H4&feature=youtu.be[
^]