Hi,
You mean you still receive the error with the code I posted?
That means that the variable MainForm has not been initialized.
If you mean that there is an active form but MainForm.ActiveForm still is Nothing, then maybe the form has not completed its initialization when you call this method.
If this doesn't help, please tell us what event are you calling MainForm.ActiveForm from, and maybe some more information about the circumstances.
Merry Christmas.
"Hugh" <an*******@discussions.microsoft.com> escribió en el mensaje news:01****************************@phx.gbl...
Hi,
I understand your point. However, there is active form
and I still receive the error message. If I started form
code window, it is undertandable that the error. How to
change a form's size programatically?
Thanks and Merry Christmas.
Hugh
-----Original Message-----
Hello, Hugh:
Try this:
'\\\
if not mainform.activeform is nothing then
mainform.activeform.width=200
else
msgbox "This application hasn't any active form."
end if
'///
Regards.
"Hugh" <an*******@discussions.microsoft.com> escribió en
el mensaje news:01****************************@phx.gbl...| Hi,
|
| I used following sentex to change form width:
|
| MainForm.ActiveForm.width = 200
|
| However, a error was generated: An unhandled exception
of | type 'System.NullReferenceException' occurred. I am
| confused. The same command works for other
applications. | Any idea.
|
| Thanks.
|
| Hugh