954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Make Background Form is Transparent

hii all i want to make background for form to be transparent i need the background only not the controls on it plz ....

i dont need to use transparent key or opacity properties

i have example to do it but it by vb 0.6 i need any one to convert it to vb.net plzzzzzzzzzz .................



i tryed to open the project in vs but it failed some code on vb 0.6 not supported on dot net plz some one help me

Attachments hide_background_Form.zip (6.01KB)
Max Bayne
Newbie Poster
1 post since May 2007
Reputation Points: 10
Solved Threads: 0
 

>I don't need to use transparent of opacity
So how do you intend to do it then?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

yeah, just use form.opacity

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

Well if you do come up with a solution other than using opacity do let me know.

arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13
 

opacity not works every-time for example if i want to use a image as my form base then every thing else must be hidden including form border.
to achieve this you have to set first form.border=none
and now to move form without border you need this code .....
http://www.daniweb.com/forums/thread31022.html
and to make the form transparent use
form.backcolor=color.hottrack
form.transperencykey=color.hottrack
you can change the colors but i suggest to use non regular colors only.

demetron
Newbie Poster
1 post since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

Transparent Form

Imports System.Runtime.InteropServices

Public Class Form1
Public Structure MARGINS
Public LeftWidth As Integer
Public RightWidth As Integer
Public TopHeight As Integer
Public Buttomheight As Integer
End Structure

Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Me.BackColor = Color.Black
Dim margins As MARGINS = New MARGINS
margins.LeftWidth = -1
margins.RightWidth = -1
margins.TopHeight = -1
margins.Buttomheight = -1
Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, margins)
Catch ex As Exception
MsgBox("Sistemul tau de operare nu are aero style!", vbCritical, "Fatal Error")
Application.Exit()
End Try
End Sub
End Class

done by "Ram basa"
Ty IT student
sandesh college

ram basa
Newbie Poster
1 post since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

hii all i want to make background for form to be transparent i need the background only not the controls on it plz .... i dont need to use transparent key or opacity properties i have example to do it but it by vb 0.6 i need any one to convert it to vb.net plzzzzzzzzzz ................. i tryed to open the project in vs but it failed some code on vb 0.6 not supported on dot net plz some one help me


Try this one:

Public Sub InitializeMyForm()
    BackColor = Color.White
    ' Make the background color of form display transparently.
    TransparencyKey = BackColor
End Sub 'InitializeMyForm
aerohn
Newbie Poster
9 posts since Dec 2011
Reputation Points: 10
Solved Threads: 1
 
Well if you do come up with a solution other than using opacity do let me know.

would also like the have the new idea

Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67
 

hii all i want to make background for form to be transparent i need the background only not the controls on it plz .... i dont need to use transparent key or opacity properties i have example to do it but it by vb 0.6 i need any one to convert it to vb.net plzzzzzzzzzz ................. i tryed to open the project in vs but it failed some code on vb 0.6 not supported on dot net plz some one help me


Just decrease the opacity in the form properties

skp03
Junior Poster in Training
51 posts since Dec 2011
Reputation Points: 12
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You