This is the web Diary and I will blog whenever I feel good to blog. I don't know how blogs were classified .. this is just a Personal Diary or my own views upon things happening around me. Most of the Posts in this blog are written in Myanmar (Burma) Native Language, known as Burmese/Myanmarsar (Not Myanmese or Barmen). This blog is composed with Winkalaw Font. I recommend you to get the Winkalaw 3 (modified) from the link below.



Download WinKalaw Font Unofficial Version 3 for Better Reading

How to make irregular Form ?

It's sort of quite easy ... in .Net

  1. Make a gif .. if you want to transparent some parts .. like cornor or anything you want it

  2. make it's(gif's) background as transparent ..

  3. put it in Form's BackGround.

  4. Give Form Back Color to Black and Transparency Key to Black.

  5. 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

Published by Kalvin on Tuesday, November 29, 2005 at 2:23 PM.

0 Responses to “How to make irregular Form”

Post a Comment


Presented by Kalvin