TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dharmendra Kumar Pandit
867
918
10.7k
Get all ToolStripMenuItem names in a array from MenuStrip
May 29 2018 6:12 AM
1. I want to show running date & time on menuStrip at runtime. Instead of lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy") + ":" + DateTime.Now.ToString("HH:mm:ss");
2. It's working in static mode. But I want at runtime while am adding ToolStripMenuItem from Database.
3. Pls Help me.
System.Windows.Forms.Timer tmr = null;
private void StartTimer()
{
tmr = new System.Windows.Forms.Timer();
tmr.Interval = 1000;
tmr.Tick += new EventHandler(tmr_Tick);
tmr.Enabled = true;
}
void tmr_Tick(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy") + ":" + DateTime.Now.ToString("HH:mm:ss");
//if (lblTime.Text == "11:30:")
//{
// if (oldForm != null)
// oldForm.Close();
// Form reportForm = new BillRpt();
// oldForm = reportForm;
// reportForm.MdiParent = this;
// reportForm.Show();
//}
}
private void MainForm_Load(object sender, EventArgs e)
{
try
{
mainmenu();
StartTimer();
}
catch (Exception)
{ }
}
Reply
Answers (
1
)
How to count total no of items in a combobox
How to show/bind data from ListView Control to GridView?