string slctcmd = string.Format("--Your SQL Query--");
DataTable dt = qc.DataReaderTable(slctcmd);
DataGridView.DataSource = dt;
DataGridView.Columns[0].Width = 200;
DataGridView.Columns[1].Width = 100;
DataGridView.Columns[2].Width = 100;
DataGridView.Columns[3].Width = 100;
DataGridView.Columns[4].Width = 100;
Wednesday, 14 December 2016
Friday, 2 December 2016
Upward Context Menu Strip on Button Click
private void button2_Click(object sender, EventArgs e)
{
Point screenpoint = button2.PointToScreen(new Point(button2.Left, button2.Bottom));
if (screenpoint.Y + contextMenuStrip1.Size.Height < Screen.PrimaryScreen.WorkingArea.Height)
{
contextMenuStrip1.Show(button2, new Point(0, -contextMenuStrip1.Size.Height));
}
else
{
contextMenuStrip1.Show(button2, new Point(0, button2.Height));
}
}
{
Point screenpoint = button2.PointToScreen(new Point(button2.Left, button2.Bottom));
if (screenpoint.Y + contextMenuStrip1.Size.Height < Screen.PrimaryScreen.WorkingArea.Height)
{
contextMenuStrip1.Show(button2, new Point(0, -contextMenuStrip1.Size.Height));
}
else
{
contextMenuStrip1.Show(button2, new Point(0, button2.Height));
}
}
Subscribe to:
Posts (Atom)