I am trying to draw a graphic on a window form using the data the user entered. In order that the graphic does not go beyond the border of the form, I need to know the length and width of the form. So I use something like 'private int By = frmGraphics.ActiveForm.Size.Height - 50;'. It runs fine, except that the 'frmGraphics.ActiveForm.Size.Height' is ignored. If I run in debug mode, I got the following error msg at that line.
"An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object."
Any idea? what is going on for that? Thanks
How to retrieve the length and width info of the form in C# Window app?
i'm not sure why or what is the error exactly,
but why don't u try to retrieve the hight or width using the get functions:
int width = this.getWidth();
int hight = this.gethight();
i think this would do the job, and u'd be able to retrieve the data u want.
good luck ;)
Reply:Try the "web developer" extension for firefox. It has a feature that lets you draw a box on the web page and view the position and dimensions. I just loaded this into my browser, and it contains tons of useful features for the developer designing/programming web sites.
Web Developer Firefox Extension
http://chrispederick.com/work/webdevelop...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment