How to make irregular Form ?
It's sort of quite easy ... in .Net
Then .. there you go .. run it .. It will cut itself in transparent parts
drawback Since you've used Black Color as Transparency Key .. so you can't use Any more Black color on your form .. but you can use Less Black like 0xFEFEFE for example. and the cursor will be a bit different when it blinking in Transparant Mode. lolz :P
How to give ability to Move irregular Form ~ Techniques
There's other of techniques I saw on the web .. using GDI, using Win32API .. but I dun like either of 'em .. so I made it like this .. and I like it .. anyway .. maybe I like this in this way.
Note For Borderless Form
xdyfqHk;rSm 'DoHk;ck aMujimygw,f/
Dim dnflag As Boolean
Dim mx As Int16
Dim my As Int16
aemuf 'DtcsdefrSm Form ay:rSm &SdorQ udk,fcsdwfcsifwJh Control trsKd;tpm;awGudk Event awG vdkufcsdwfvdkufw,f/ avmavmq,f Label eJU yJ csdwfxm;w,f/ Picture Box, Panel tJ'gawGeJU wGJ .. pojzifh MudKufwmeJU wGJvdkU&ygw,f/
Private Sub pwform_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xCtrl As Control
For Each xCtrl In Me. Controls
If TypeOf xCtrl Is Label Then
AddHandler xCtrl.MouseDown, AddressOf Me. pwform_MouseDown
AddHandler xCtrl.MouseMove, AddressOf Me. pwform_MouseMove
AddHandler xCtrl.MouseUp, AddressOf Me. pwform_MouseUp
End If
Next
End Sub
'guawmh rjzpfrae xnfhudk xnfh&r,fh[mawGyg/
Private Sub pwform_MouseDown (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseDown
MDown(e)
End Sub
Private Sub pwform_MouseMove (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseMove
MMove(e)
End Sub
Private Sub pwform_MouseUp (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseUp
Mup()
End Sub
tckvdk cGJxm;wmuawmh Class wcktjzpf Optimize vkyfrvdkUyg/ ckawmh rvkyf&ao;ygbl;/
Private Sub MDown (ByVal e As System.Windows.Forms.MouseEventArgs )
dnflag = True
mx = e.X
my = e.Y
End Sub
Private Sub Mup()
dnflag = False
End Sub
Private Sub MMove (ByVal e As System.Windows.Forms.MouseEventArgs )
If dnflag Then
Me. Left += e.X - mx
Me. Top += e.Y - my
End If
End Sub
Published by Kalvin on Tuesday, November 29, 2005 at
2:23 PM.
It's sort of quite easy ... in .Net
- Make a gif .. if you want to transparent some parts .. like cornor or anything you want it
- make it's(gif's) background as transparent ..
- put it in Form's BackGround.
- Give Form Back Color to Black and Transparency Key to Black.
- Make your form as border less form.
Then .. there you go .. run it .. It will cut itself in transparent parts
drawback Since you've used Black Color as Transparency Key .. so you can't use Any more Black color on your form .. but you can use Less Black like 0xFEFEFE for example. and the cursor will be a bit different when it blinking in Transparant Mode. lolz :P
How to give ability to Move irregular Form ~ Techniques
There's other of techniques I saw on the web .. using GDI, using Win32API .. but I dun like either of 'em .. so I made it like this .. and I like it .. anyway .. maybe I like this in this way.
Note For Borderless Form
xdyfqHk;rSm 'DoHk;ck aMujimygw,f/
Dim dnflag As Boolean
Dim mx As Int16
Dim my As Int16
aemuf 'DtcsdefrSm Form ay:rSm &SdorQ udk,fcsdwfcsifwJh Control trsKd;tpm;awGudk Event awG vdkufcsdwfvdkufw,f/ avmavmq,f Label eJU yJ csdwfxm;w,f/ Picture Box, Panel tJ'gawGeJU wGJ .. pojzifh MudKufwmeJU wGJvdkU&ygw,f/
Private Sub pwform_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xCtrl As Control
For Each xCtrl In Me. Controls
If TypeOf xCtrl Is Label Then
AddHandler xCtrl.MouseDown, AddressOf Me. pwform_MouseDown
AddHandler xCtrl.MouseMove, AddressOf Me. pwform_MouseMove
AddHandler xCtrl.MouseUp, AddressOf Me. pwform_MouseUp
End If
Next
End Sub
'guawmh rjzpfrae xnfhudk xnfh&r,fh[mawGyg/
Private Sub pwform_MouseDown (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseDown
MDown(e)
End Sub
Private Sub pwform_MouseMove (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseMove
MMove(e)
End Sub
Private Sub pwform_MouseUp (ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs ) Handles MyBase. MouseUp
Mup()
End Sub
tckvdk cGJxm;wmuawmh Class wcktjzpf Optimize vkyfrvdkUyg/ ckawmh rvkyf&ao;ygbl;/
Private Sub MDown (ByVal e As System.Windows.Forms.MouseEventArgs )
dnflag = True
mx = e.X
my = e.Y
End Sub
Private Sub Mup()
dnflag = False
End Sub
Private Sub MMove (ByVal e As System.Windows.Forms.MouseEventArgs )
If dnflag Then
Me. Left += e.X - mx
Me. Top += e.Y - my
End If
End Sub
0 Responses to “How to make irregular Form”