*Sitemize Üye Olunca Elinize Ne Geçer?

<--- 1. Üye Olarak Linkleri Görebilirsiniz... --->

<--- 2. İstediğiniz Kadar Paylaşım Yapabilirsiniz... --->

<--- 3. Güzel Bir Forum Hayatı Yaşayabilirsiniz... --->


Join the forum, it's quick and easy


*Sitemize Üye Olunca Elinize Ne Geçer?

<--- 1. Üye Olarak Linkleri Görebilirsiniz... --->

<--- 2. İstediğiniz Kadar Paylaşım Yapabilirsiniz... --->

<--- 3. Güzel Bir Forum Hayatı Yaşayabilirsiniz... --->

Would you like to react to this message? Create an account in a few clicks or log in to continue.

● En Güncel Paylaşım Platformu ●

---Misafir--- Hos Geldiniz Daha iyi Bir Hizmet İçin Üye olunuz.ÜyeLer Link GörebiLir

    Vb Kod Form Size Gülsün

    MnyTirith
    MnyTirith
    ● Admin ●
    ● Admin ●


    <b>Doğum tarihi</b> Doğum tarihi : 20/06/90

    Vb Kod Form Size Gülsün Empty Vb Kod Form Size Gülsün

    Mesaj tarafından MnyTirith Cuma Mart 12, 2010 9:38 pm

    projemize bir form ve 2 adet modül ekleyelim. Formumuza bir command buton koyalım.

    forma;

    Private Sub Form_Load()
    Smiley Me
    End Sub

    Private Sub Form_Resize()
    Dim oldSmiley
    oldSmiley = leSmiley
    Smiley Me
    DeleteObject oldSmiley
    End Sub

    Private Sub Command1_Click()
    SetWindowRgn Me.hwnd, 0, False
    DeleteObject leSmiley
    End
    End Sub

    yazalım.

    1. modüle

    Declare Function CreateRectRgn Lib "gdi32" ( _
    ByVal X1 As Long, _
    ByVal Y1 As Long, _
    ByVal X2 As Long, _
    ByVal Y2 As Long) _
    As Long

    Declare Function CreateEllipticRgn Lib "gdi32" ( _
    ByVal X1 As Long, _
    ByVal Y1 As Long, _
    ByVal X2 As Long, _
    ByVal Y2 As Long) _
    As Long

    Declare Function CreatePolygonRgn Lib "gdi32" ( _
    lpPoint As POINTAPI, _
    ByVal nCount As Long, _
    ByVal nPolyFillMode As Long _
    ) As Long

    Type POINTAPI
    X As Long
    Y As Long
    End Type

    '
    Public Const ALTERNATE = 1
    Public Const WINDING = 2

    Declare Function CombineRgn Lib "gdi32" ( _
    ByVal hDestRgn As Long, _
    ByVal hSrcRgn1 As Long, _
    ByVal hSrcRgn2 As Long, _
    ByVal nCombineMode As CombineMode _
    ) As Long

    Public Enum CombineMode
    RGN_AND = 1

    RGN_COPY = 5
    RGN_DIFF = 4

    RGN_OR = 2
    RGN_XOR = 3
    End Enum

    Declare Function SetWindowRgn Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal hRgn As Long, _
    ByVal bRedraw As Boolean _
    ) As Long

    Declare Function DeleteObject Lib "gdi32" ( _
    ByVal hObject As Long _
    ) As Long

    2.modüle ise

    Option Explicit
    Dim leSmiley As Long

    Sub Smiley(obj As Form)

    Dim X As Long, Y As Long
    X = obj.Width / Screen.TwipsPerPixelX
    Y = obj.Height / Screen.TwipsPerPixelY

    Dim Grond As Long
    Dim Gsmile As Long
    Dim Psmile As Long
    Dim Rect As Long
    Dim eyeG As Long
    Dim eyeD As Long

    Dim Bouee As Long
    Dim leSmile As Long
    Dim Yeux As Long
    Dim Tete As Long
    Dim LesPoints(0 To 4) As POINTAPI

    Grond = CreateEllipticRgn(0, 0, X, Y)
    Gsmile = CreateEllipticRgn(Int(X / 10), Int(Y / 10), Int(X * 9 / 10), Int(Y * 9 / 10))
    Psmile = CreateEllipticRgn(Int(X * 2 / 10), Int(Y * 4 / 10), Int(X * 8 / 10), Int(Y * 8 / 10))
    LesPoints(0).X = 0
    LesPoints(0).Y = 0
    LesPoints(1).X = X
    LesPoints(1).Y = 0
    LesPoints(2).X = X
    LesPoints(2).Y = Int(Y * 8 / 10)
    LesPoints(3).X = Int(X / 2)
    LesPoints(3).Y = Int(Y / 2)
    LesPoints(4).X = 0
    LesPoints(4).Y = Int(Y * 8 / 10)
    Rect = CreatePolygonRgn(LesPoints(0), 5, 1)
    eyeG = CreateEllipticRgn(Int(X * 2 / 10), Int(Y * 3 / 10), Int(X * 4 / 10), Int(Y * 5 / 10))
    eyeD = CreateEllipticRgn(Int(X * 6 / 10), Int(Y * 3 / 10), Int(X * 8 / 10), Int(Y * 5 / 10))

    Bouee = CreateEllipticRgn(0, 0, X, Y)
    leSmile = CreateEllipticRgn(0, 0, X, Y)
    Yeux = CreateEllipticRgn(0, 0, X, Y)
    Tete = CreateEllipticRgn(0, 0, X, Y)
    leSmiley = CreateEllipticRgn(0, 0, X, Y)

    CombineRgn Bouee, Gsmile, Psmile, RGN_DIFF
    CombineRgn leSmile, Bouee, Rect, RGN_DIFF
    CombineRgn Yeux, eyeG, eyeD, RGN_OR
    CombineRgn Tete, Grond, Yeux, RGN_DIFF
    CombineRgn leSmiley, Tete, leSmile, RGN_DIFF

    DeleteObject Grond
    DeleteObject Gsmile
    DeleteObject Psmile
    DeleteObject Rect
    DeleteObject eyeG
    DeleteObject eyeD
    DeleteObject Bouee
    DeleteObject leSmile
    DeleteObject Yeux
    DeleteObject Tete

    SetWindowRgn obj.hwnd, leSmiley, True
    End Sub

    kodlarını ekleyelim. evet artık sizin de formunuz gülüyor:))

      Forum Saati Salı Mayıs 14, 2024 3:09 am