473,412 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

How to check if a BackgroundImage property has any image?

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
3 3815
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
* "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
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ken Lee | last post by:
Hi all, I'm sort of very new to C# and haven't programmed in OO for a while. I'm trying to override the backgroundimage to the tabcontrol but it just doesn't seem to want to do it, can someone...
1
by: kjon | last post by:
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...
1
by: John | last post by:
Hello all, I was wondering, does this property really exist in VB.NET 2003? Because it's listed in Intellisense, but setting it doesn't seem to have the slightest effect on the visual look of...
3
by: Sakharam Phapale | last post by:
Hi All, How to set the background image for TrackBar control. Since BackgroundImage property doesn't visible in design mode, I tried doing it in run time as follows, ...
1
by: VB Programmer | last post by:
I am trying to check which image is currently the BackgroundImage (VB.NET 2005). Can you help me out? Me.BackgroundImage.ToString doesn't work. Here's the sample code... Select Case...
12
by: Sharon | last post by:
I’m using a Panel control in my form to display a background image. So in the Form OnPaint() I wrote: myPanel.BackgroundImage = m_bmp; While the m_bmp is the Form Bitmap member. The problem...
1
by: moi.romanowsky | last post by:
Does anyone know why the backgroundImage does not display in VB? I have tried setting it in the properties window (where the thumbnail shows) and explicitly in my code like so: ...
7
by: rodchar | last post by:
hey all, how do i change the BackgroundImage property of my form in code? thanks, rodchar
2
by: Frank | last post by:
For various reasons I want to use a PictureBox to display images. That is I want sometimes to assign an Image to the PictureBox Sometimes I want to draw on that Image. What are the reasons for...
4
by: =?Utf-8?B?cmF5IG4=?= | last post by:
I have a need to put an image on the background of a SplitterPanel. However, I need it to appear in the bottom right corner of the panel instead of the standard Centered/Tiled/Stretched found in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.