Splitter control question

R

Roshawn

Hi,

I was wondering if I could specify a background image for the splitter
control. On the Properties tab the property is not there, yet if I create
the splitter entirely in code the IntelliSense window reveals that a
BackgroundImage property exists.

What is the proper way to set this property (in code)?

Thanks,
Roshawn
 
K

Ken Tucker [MVP]

Hi,

I am not sure why you want to put an image on something 3 pixels
wide but you could add code in the paint event to draw the image.
Private Sub Splitter1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Splitter1.Paint

Dim g As Graphics = e.Graphics

Dim rDraw As New Rectangle(0, 0, Splitter1.Width, Splitter1.Height)

g.DrawImage(Image.FromFile("C:\Camera.bmp"), rDraw)

End Sub

Ken
 
C

ClayB [Syncfusion]

You can use code such as this to retrieve a bitmap from a file. (Or, you
could get it from an ImageList, or whereever?)

this.splitter1.BackgroundImage = Bitmap.FromFile(@"C:\My
Pictures\sync.bmp");

====================
Clay Burch, .NET MVP
Visit www.syncfusion.com for the coolest tools
 
H

Herfried K. Wagner [MVP]

* "Roshawn said:
I was wondering if I could specify a background image for the splitter
control. On the Properties tab the property is not there, yet if I create
the splitter entirely in code the IntelliSense window reveals that a
BackgroundImage property exists.

I don't understand that too...

;-)

\\\
Splitter1.BackgroundImage = _
Image.FromFile("C:\WINDOWS\angler.bmp")
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top