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
aapt.temp
NA
4
0
NullReferenceException
Feb 16 2005 8:14 PM
Hi, I need to print my form on a printer, that is all values from the textboxes, comboboxes etc. preferrably in a graphical manner. I found an example on the internet to print out textboxes which has the following code: for (int i = 0; i < this.Controls.Count; i++){ if (this.Controls[i] is TextBox) g.DrawString(this.Controls[i].Text, this.Controls[i].Font, Brushes.Black, this.Controls[i].Bounds.Left*scalex, this.Controls[i].Bounds.Top * scaley, new StringFormat()); } But no matter what I tried it always throws a NullReferenceException. Could anyone please tell me what's the matter with it, I'm just clueless. Or could anyone please give me another example or point me to a tutorial or anything. I've been struggling with the printing for a few days now and nothing seems to work. Thanks a lot.
Reply
Answers (
1
)
Problems getting values to add using a class
How to print form values graphically