|
-
Nov 30th, 2003, 10:31 AM
#1
Thread Starter
Member
Background image in a Form in VB.NET
Can someone tell me how to put a background image in a Form in VB.NET?
I used a PictureBox, but is it possible to put an image in a Form without it ?
I tried using the "Background Image" property of the Form, but the problem is that the form has another property called "Backcolor" that puts an "opaque" color (it doesn´t let me put the value "transparent" in a Form) and so it hides the image.
-
Nov 30th, 2003, 11:18 AM
#2
I wonder how many charact
I don't understand your problem.
All forms have a backcolor property. But it is irrelevant when you set the BackGroundImage to anything other than Nothing.
Start a new Windows Application, set the BackgroundImage to an image on your computer. Run the application. It works AS IS.
-
Nov 30th, 2003, 05:08 PM
#3
Thread Starter
Member
I did that several times, and i did it once more.
When i run the app, the Form only appears with the default color of the Backcolor property, no Image appears.
I'm using VS.NET 2002.
-
Dec 1st, 2003, 03:39 AM
#4
I agree with nemaroller.
Can you zip up the project you created (just the one form with the background image) and post it? I'm also running 2002 and I'll let you know what happens when I run it on my PC.
This world is not my home. I'm just passing through.
-
Dec 1st, 2003, 09:13 AM
#5
Thread Starter
Member
i did it now with an empty form... but with my app no
...and the properties of the two forms are equal...what a heck ?!
-
Dec 1st, 2003, 09:23 AM
#6
Thread Starter
Member
it's unbealivable...
sometimes it does and others don't ... actually it only give me once
-
Dec 1st, 2003, 09:42 AM
#7
If you want to let me see a copy of your "empty" project I'll see if I can spot something. Otherwise, I don't think I can help.
This world is not my home. I'm just passing through.
-
Dec 1st, 2003, 09:46 AM
#8
Thread Starter
Member
Ok i finally got the Microsoft logic for the "beast"...
...it's unbealivable, but ...well... whatever...it's Microsoft you know !?
Well here it is, when i change the BackgroundImage property of any control (Forms, Buttons,...) i have to do the "Save All" to the Project, for him to update the value of the BackgroundImage property.
If i don´t make the "Save All", the value of the BackgroundImage property stays always with the old value.
UUUUUUUUUUnbealivable ....but it works now 
Many thanks anyway trisuglow, but it finally works.
-
Dec 1st, 2003, 09:50 AM
#9
Thread Starter
Member
Here it is, the damn code (but with no "Save All"):
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Bitmap)
Me.ClientSize = New System.Drawing.Size(792, 566)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
Me.Text = "Form1"
End Sub
#End Region
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|