By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,262 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,262 IT Pros & Developers. It's quick & easy.

How to check if a BackgroundImage property has any image?

P: n/a
Hi, I'm trying to get the BackgroundImage of a form/control and draw it
again in runtime. But if the Backgroundimage is "None", the DrawImage
command will give an error.
Is it possible to programmaticaly check the Backgroundimage property of the
form/control in runtime whether it is "None" or has an image inside? Please
advice. Thanks in advance.

Regards,
KJon
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi kjon,
Hi, I'm trying to get the BackgroundImage of a form/control and draw
it again in runtime. But if the Backgroundimage is "None", the
DrawImage command will give an error.
Is it possible to programmaticaly check the Backgroundimage property
of the form/control in runtime whether it is "None" or has an image
inside? Please advice. Thanks in advance.


Not tried, but:

If ( MyForm.BackgroundImage is Nothing ) ...?
Regards,

Frank Eller

Nov 20 '05 #2

P: n/a
* "Frank Eller [MVP]" <fe******@frankeller.de> scripsit:
Hi, I'm trying to get the BackgroundImage of a form/control and draw
it again in runtime. But if the Backgroundimage is "None", the
DrawImage command will give an error.
Is it possible to programmaticaly check the Backgroundimage property
of the form/control in runtime whether it is "None" or has an image
inside? Please advice. Thanks in advance.


Not tried, but:

If ( MyForm.BackgroundImage is Nothing ) ...?


Works, but in VB.NET you don't need the '(...)' around the
condition... :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

P: n/a
* "Frank Eller [MVP]" <fe******@frankeller.de> scripsit:
Hi, I'm trying to get the BackgroundImage of a form/control and draw
it again in runtime. But if the Backgroundimage is "None", the
DrawImage command will give an error.
Is it possible to programmaticaly check the Backgroundimage property
of the form/control in runtime whether it is "None" or has an image
inside? Please advice. Thanks in advance.


Not tried, but:

If ( MyForm.BackgroundImage is Nothing ) ...?


Works, but in VB.NET you don't need the '(...)' around the
condition... :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.