Click here to Skip to main content
11,927,378 members (48,494 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
Why is my form blinking.
when i press a button inside the form,the form will blink and not disappear, and then press the button the form will disappear .

plz,plz, Anyone Can Help Me
Posted 19-Nov-12 2:55am
Subrata_Kolkata 19-Nov-12 7:58am
What is the code inside button click event?
CPallini 19-Nov-12 8:08am
You should post the relevant code.
Krunal R 19-Nov-12 8:11am
Show your code..
E.F. Nijboer 19-Nov-12 8:13am
Try move the first window... do you see another form under it? Did you create it twice?
Nelek 19-Nov-12 17:20pm
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.
what have you tried?[^]
Zain -Ul- Arifeen 21-Nov-12 6:39am
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Company_Accounts
public partial class MyMessageBox : Form

static MyMessageBox newMessageBox;
static string Button_id;
public static DataGridViewRow dr;
public Timer msgTimer;
int disposeFormTimer;
public MyMessageBox()

private void MyMessageBox_Load(object sender, EventArgs e)
ControlBox = false;
disposeFormTimer = 30;
newMessageBox.lblTimer.Text = disposeFormTimer.ToString();
msgTimer = new Timer();
msgTimer.Interval = 1000;
msgTimer.Enabled = true;
msgTimer.Tick += new System.EventHandler(this.timer1_Tick );
public static string ShowBox(string txtMessage, string txtTitle)
newMessageBox = new MyMessageBox();
newMessageBox.label3.Text = txtTitle;
newMessageBox.label1.Text = txtMessage;
return Button_id;

private void btnlist_Click(object sender, EventArgs e)
Button_id = "3";


private void btnrenter_Click(object sender, EventArgs e)
Button_id = "1";


private void btnadd_Click(object sender, EventArgs e)

Button_id = "2";


private void timer1_Tick(object sender, EventArgs e)

if (disposeFormTimer >= 0)
newMessageBox.lblTimer.Text = disposeFormTimer.ToString();
this my form code.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your code is making it blink. It's doing what you asked it to, and we can't help based on this vague request

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100