c# - Why does the menu strip white out when subscribing to a picture box paint event? -


I have a form with MenuStrip and PictureBox . I subscribe to PictureBox from Paint event with the following code:

  Private Zero ImageBox 1_Paint (Object Sender, PaintEventArgs e) {pictureBox1 . Image = new bitmap (picture box 1. wide, picture box 1.high); // Other code but above line reflects the problem}   

causes the menu strip to be white - I do not see the text till then I can move around it - even if PictureBox Menu does not overlap at all at the end of the above function I menuStrip1.Update () I can put it, but this can lead to other problems.

to assign any drawing instead of specifying PictureBox Use the PaintEventArgs .

  Private Zero PictureBox 1_Paint (Object Sender, PaintEventArgs e) {e.Graphics.Clear (Color.Gray); }    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -