473,466 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Align Anchor Panel BackgroundImage

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 the BackgroundImageLayout Property.

Is there an example of how to do that or could someone offer a suggestion?

Thanks
Feb 6 '07 #1
4 3540
Hi,

You could try painting it yourself. Add an event handler for the splitter's
Paint event, grab its Graphics object from the EventArgs argument (e) and
use the DrawImage method.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"ray n" <ray n@discussions.microsoft.comwrote in message
news:AD**********************************@microsof t.com...
>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 the BackgroundImageLayout
Property.

Is there an example of how to do that or could someone offer a suggestion?

Thanks

Feb 6 '07 #2
Hi Dave,

Thanks for the response. I was able to draw the image where I wanted as you
specified. However, the crucial part is having it set as the backgroundimage
property.

The reason for this madness is b/c there is a third party tool I'm using
that has a transparency property. However, the only thing it is transparent
to is its container's backcolor, or backgroundimage.

Is there a way to override the PaintBackgroundImage event (if such one
exists) and insert my paint code that way?

"Dave Sexton" wrote:
Hi,

You could try painting it yourself. Add an event handler for the splitter's
Paint event, grab its Graphics object from the EventArgs argument (e) and
use the DrawImage method.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"ray n" <ray n@discussions.microsoft.comwrote in message
news:AD**********************************@microsof t.com...
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 the BackgroundImageLayout
Property.

Is there an example of how to do that or could someone offer a suggestion?

Thanks


Feb 7 '07 #3
Hi,

There's no override for painting only the background image, but there is a
protected OnPaintBackground method that you could try, although you'd have
to derive a control from SplitterPanel (if it's not sealed) and make sure
that it's not painting everything in Paint (i.e., make sure the
OnPaintBackground method is actually being invoked).

The behavior you mention is normal for WinForms on Windows XP, which just
emulates transparency on Controls (poorly). You may or may not be happy to
know that true transparency in WinForms seems to work just fine on Vista :)

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"ray n" <ra**@discussions.microsoft.comwrote in message
news:64**********************************@microsof t.com...
Hi Dave,

Thanks for the response. I was able to draw the image where I wanted as
you
specified. However, the crucial part is having it set as the
backgroundimage
property.

The reason for this madness is b/c there is a third party tool I'm using
that has a transparency property. However, the only thing it is
transparent
to is its container's backcolor, or backgroundimage.

Is there a way to override the PaintBackgroundImage event (if such one
exists) and insert my paint code that way?

"Dave Sexton" wrote:
>Hi,

You could try painting it yourself. Add an event handler for the
splitter's
Paint event, grab its Graphics object from the EventArgs argument (e) and
use the DrawImage method.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"ray n" <ray n@discussions.microsoft.comwrote in message
news:AD**********************************@microso ft.com...
>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 the BackgroundImageLayout
Property.

Is there an example of how to do that or could someone offer a
suggestion?

Thanks



Feb 7 '07 #4
Ok, that helped me get it.

I just extended the third party control and did an override on the
OnPaintBackground method.

After calling the base.OnPaintBackground, I was able to place my image on
the control.

..NET makes things like this easy to do.

It's just the process of figuring out HOW to do it that's hard.

Thanks for you help! :)
Feb 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MuZZy | last post by:
Hello, I just started studying WinForms and first problem i got when i dropped a panel on the form and wanted to do: Panel.Align = alClient but... WinPanel doesn't have such member!!! ...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
5
by: ZippyV | last post by:
Hello everybody, A couple of years ago I wrote a program in VB6. Using the designer I could align my labels to the right. When the text of the labels would change, the autosize feature would...
1
by: Wolfgang | last post by:
I'm a Java developer relatively new to to VB .NET (and I don't know the old VB6 at all). I know how to draw lines, circles and other simple shapes on a form in VB.NET (using the onPaint event)....
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...
3
by: bloc | last post by:
I am programming an interactive CV using xml, xslt and java script. The page consists of a header which contains links to various 'sections' on the xml cv, a left and right menu, and a central...
2
by: Dinesh | last post by:
Dear All, Can u tell me how to center align a div (Panel) in Asp.Net 2.0. If we use align="center" then it will be converted to text-align:center which will align all the content of the div's...
0
by: =?Utf-8?B?RXJpYw==?= | last post by:
Hello All, I have an Image where the corners of them are set to transparent (a=0, r=255, b=255,g=255) and I load this image as a Bitmap into the BackgroundImage property of a windows panel. When...
6
by: Alfonso2968 | last post by:
Hello, If someone can help plz. I have searched everything and all I can find is how to drag and drop within a form from panel to panel. What I need to do is Drag an image from the desktop...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.