Click here to Skip to main content
15,899,474 members

Comments by sharat naik (Top 32 by date)

sharat naik 20-Mar-19 7:24am View    
how any logic please suggest me.
sharat naik 21-Mar-18 22:44pm View    
Its working nice.................

Timer Active_Timer = new Timer();
Form frmShow = new Form();

public MainForm()
{
InitializeComponent();
Active_Timer.Interval = 100;
Active_Timer.Tick += new EventHandler(Active_Timer_Tick);
Active_Timer.Start();
}

private async void Active_Timer_Tick(object sender, EventArgs e)
{
bool IsOpen = false;
this.Hide();
SqlConnection con = new SqlConnection(connection);
con.Open();
SqlCommand cmd = new SqlCommand("select Form_Name from Display_External_Selected where Type=4", con);
SqlDataReader rdr = cmd.ExecuteReader();
if (rdr.HasRows)
{
rdr.Read();
var Frm_Name = (string)rdr["Form_Name"];
var str_array = Frm_Name.Split(',');
SqlCommand cmdd; SqlDataReader reader; SqlConnection conn;

for (var i = 0; i < str_array.Length; i++)
{
Active_Timer.Stop();
conn = new SqlConnection(connection);
conn.Open();
cmdd = new SqlCommand("select Form_Active from Display_Parameters where Form_No=" + str_array[i] + "", conn);
reader = cmdd.ExecuteReader();
if (reader.HasRows)
{
reader.Read();
var Active_Frm_Name = (string)reader["Form_Active"];
IsOpen = true;
string formTypeFullName = string.Format("{0}.{1}", this.GetType().Namespace, Active_Frm_Name);
Type type = Type.GetType(formTypeFullName, true);
Form frmShow = (Form)Activator.CreateInstance(type);
frmShow.Location = new Point(0, 0);
frmShow.Size = Screen.PrimaryScreen.WorkingArea.Size;
frmShow.StartPosition = FormStartPosition.CenterScreen;
if (IsOpen == true)
{
frmShow.Show();
IsOpen = false;
}
if (IsOpen == false)
{
await Task.Delay(3000);
frmShow.Close();
}
Active_Timer.Enabled = false;
Active_Timer.Start();
Active_Timer.Interval = 1000;

}

}
con.Close();
}
}
sharat naik 7-Mar-18 1:57am View    
Deleted
--content has been removed due to updation of question---
sharat naik 6-Mar-18 6:16am View    
Deleted
question has changed... please help me
sharat naik 21-Feb-18 2:30am View    
Is their any form sliding tool in telerik,i want to display full screen forms, please suggest me..