Why Join
Become a member
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
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
S J
1.8k
166
4.2k
PaintEventArgs e showing null reference
Nov 26 2020 5:17 AM
hi
public
void
Paint(PaintEventArgs e)
//here e is showing null reference in class {"Object reference not set to an instance of an object."}//
{
//Graphics g = e.Graphics;
e.Graphics.DrawRectangle(pen1, rect);
}
how to avoid this I need to draw a rectangle by using class method but when I call paint method showing null reference exception.
Reply
Answers (
4
)
Error two rectangles intersection same location and size in c#
When C# allows to set string as null then why nullable string is intro