944,089 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 14002
  • VB.NET RSS
May 4th, 2007
0

Make Background Form is Transparent

Expand Post »
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
Attached Files
File Type: zip hide background Form.zip (6.0 KB, 900 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Max Bayne is offline Offline
1 posts
since May 2007
May 4th, 2007
0

Re: Make Background Form is Transparent

>I don't need to use transparent of opacity
So how do you intend to do it then?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 4th, 2007
0

Re: Make Background Form is Transparent

yeah, just use form.opacity
Moderator
Featured Poster
Reputation Points: 1800
Solved Threads: 575
Moderator
jbennet is online now Online
16,534 posts
since Apr 2005
May 5th, 2007
0

Re: Make Background Form is Transparent

Well if you do come up with a solution other than using opacity do let me know.
Reputation Points: 347
Solved Threads: 13
Practically a Posting Shark
arjunsasidharan is offline Offline
812 posts
since Aug 2006
Dec 31st, 2010
0
Re: Make Background Form is Transparent
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
demetron is offline Offline
1 posts
since Dec 2010
Dec 19th, 2011
0

Transparent form in vb.net

Transparent Form

Imports System.Runtime.InteropServices

Public Class Form1
<Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure MARGINS
Public LeftWidth As Integer
Public RightWidth As Integer
Public TopHeight As Integer
Public Buttomheight As Integer
End Structure

<Runtime.InteropServices.DllImport("dwmapi.dll")> 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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ram basa is offline Offline
1 posts
since Dec 2011
Dec 20th, 2011
0

Re:

Click to Expand / Collapse  Quote originally posted by Max Bayne ...
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:

VB.NET Syntax (Toggle Plain Text)
  1. Public Sub InitializeMyForm()
  2. BackColor = Color.White
  3. ' Make the background color of form display transparently.
  4. TransparencyKey = BackColor
  5. End Sub 'InitializeMyForm
Reputation Points: 10
Solved Threads: 1
Newbie Poster
aerohn is offline Offline
9 posts
since Dec 2011
Dec 20th, 2011
0
Re: Make Background Form is Transparent
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
Reputation Points: 43
Solved Threads: 67
Veteran Poster
Netcode is offline Offline
1,016 posts
since Jun 2009
Dec 20th, 2011
0
Re: Make Background Form is Transparent
Click to Expand / Collapse  Quote originally posted by Max Bayne ...
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
Reputation Points: 12
Solved Threads: 0
Light Poster
skp03 is offline Offline
33 posts
since Dec 2011
Message:
Previous Thread in VB.NET Forum Timeline: SQL Server, VB.net
Next Thread in VB.NET Forum Timeline: how to add string to a text box, returned from another form that has a list box





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC