تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
How To Move Borderless Form
#1
كاتب الموضوع : BADRMEDIA

::: How To Move Borderless Form :::

Declare Variables in General Blank

كود :
[color=#000000][COLOR=#0000bb] Dim drag [/color][color=#007700]As [/color][COLOR=#0000bb]Boolean
    Dim mousex [/COLOR][color=#007700]As [/color][COLOR=#0000bb]Integer
    Dim mousey [/COLOR][color=#007700]As [/color][COLOR=#0000bb]Integer  
[/COLOR][/COLOR]

Then


كود :
[COLOR=#000000][COLOR=#0000bb]
[/COLOR][color=#007700]Private [/color][color=#0000bb]Sub FrmBADRMEDIA_MouseDown[/color][color=#007700]([/color][color=#0000bb]ByVal sender [/color][color=#007700]As [/color][color=#0000bb]Object[/color][color=#007700], [/color][color=#0000bb]ByVal e [/color][color=#007700]As [/color][color=#0000bb]System[/color][color=#007700].[/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]MouseEventArgs[/color][color=#007700]) [/color][color=#0000bb]Handles Me[/color][color=#007700].[/color][COLOR=#0000bb]MouseDown
        drag [/COLOR][color=#007700]= [/color][COLOR=#0000bb]True
        mousex [/COLOR][color=#007700]= [/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]Cursor[/color][color=#007700].[/color][color=#0000bb]Position[/color][color=#007700].[/color][color=#0000bb]X [/color][color=#007700]- [/color][color=#0000bb]Me[/color][color=#007700].[/color][COLOR=#0000bb]Left
        mousey [/COLOR][color=#007700]= [/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]Cursor[/color][color=#007700].[/color][color=#0000bb]Position[/color][color=#007700].[/color][color=#0000bb]Y [/color][color=#007700]- [/color][color=#0000bb]Me[/color][color=#007700].[/color][COLOR=#0000bb]Top
    End Sub

    [/COLOR][color=#007700]Private [/color][color=#0000bb]Sub FrmBADRMEDIA_MouseMove[/color][color=#007700]([/color][color=#0000bb]ByVal sender [/color][color=#007700]As [/color][color=#0000bb]Object[/color][color=#007700], [/color][color=#0000bb]ByVal e [/color][color=#007700]As [/color][color=#0000bb]System[/color][color=#007700].[/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]MouseEventArgs[/color][color=#007700]) [/color][color=#0000bb]Handles Me[/color][color=#007700].[/color][COLOR=#0000bb]MouseMove
        [/COLOR][color=#007700]If [/color][COLOR=#0000bb]drag Then
            Me[/COLOR][color=#007700].[/color][color=#0000bb]Top [/color][color=#007700]= [/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]Cursor[/color][color=#007700].[/color][color=#0000bb]Position[/color][color=#007700].[/color][color=#0000bb]Y [/color][color=#007700]- [/color][COLOR=#0000bb]mousey
            Me[/COLOR][color=#007700].[/color][color=#0000bb]Left [/color][color=#007700]= [/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]Cursor[/color][color=#007700].[/color][color=#0000bb]Position[/color][color=#007700].[/color][color=#0000bb]X [/color][color=#007700]- [/color][COLOR=#0000bb]mousex
        End [/COLOR][COLOR=#007700]If
    [/COLOR][COLOR=#0000bb]End Sub

    [/COLOR][color=#007700]Private [/color][color=#0000bb]Sub FrmBADRMEDIA_MouseUp[/color][color=#007700]([/color][color=#0000bb]ByVal sender [/color][color=#007700]As [/color][color=#0000bb]Object[/color][color=#007700], [/color][color=#0000bb]ByVal e [/color][color=#007700]As [/color][color=#0000bb]System[/color][color=#007700].[/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]MouseEventArgs[/color][color=#007700]) [/color][color=#0000bb]Handles Me[/color][color=#007700].[/color][COLOR=#0000bb]MouseUp
        drag [/COLOR][color=#007700]= [/color][COLOR=#0000bb]False
    End Sub  
[/COLOR][/COLOR]


This Is Simple

}}}}
تم الشكر بواسطة:
#2
كاتب المشاركة : GinoSama

Or you can do this one


كود :
[color=#000000][COLOR=#0000bb]Dim X[/color][color=#007700], [/color][color=#0000bb]Y [/color][color=#007700]As [/color][COLOR=#0000bb]Integer  
[/COLOR][/COLOR]




كود :
[color=#000000][COLOR=#007700]Private [/color][color=#0000bb]Sub Form1_MouseDown[/color][color=#007700]([/color][color=#0000bb]ByVal sender [/color][color=#007700]As [/color][color=#0000bb]Object[/color][color=#007700], [/color][color=#0000bb]ByVal e [/color][color=#007700]As [/color][color=#0000bb]System[/color][color=#007700].[/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]MouseEventArgs[/color][color=#007700]) [/color][color=#0000bb]Handles Me[/color][color=#007700].[/color][COLOR=#0000bb]MouseDown
        X [/COLOR][color=#007700]= [/color][color=#0000bb]Control[/color][color=#007700].[/color][color=#0000bb]MousePosition[/color][color=#007700].[/color][color=#0000bb]X [/color][color=#007700]- [/color][color=#0000bb]Me[/color][color=#007700].[/color][color=#0000bb]Location[/color][color=#007700].[/color][COLOR=#0000bb]X
        Y [/COLOR][color=#007700]= [/color][color=#0000bb]Control[/color][color=#007700].[/color][color=#0000bb]MousePosition[/color][color=#007700].[/color][color=#0000bb]Y [/color][color=#007700]- [/color][color=#0000bb]Me[/color][color=#007700].[/color][color=#0000bb]Location[/color][color=#007700].[/color][COLOR=#0000bb]Y
    End Sub  
[/COLOR][/COLOR]




كود :
[color=#000000][COLOR=#007700]Private [/color][color=#0000bb]Sub Form1_MouseMove[/color][color=#007700]([/color][color=#0000bb]ByVal sender [/color][color=#007700]As [/color][color=#0000bb]Object[/color][color=#007700], [/color][color=#0000bb]ByVal e [/color][color=#007700]As [/color][color=#0000bb]System[/color][color=#007700].[/color][color=#0000bb]Windows[/color][color=#007700].[/color][color=#0000bb]Forms[/color][color=#007700].[/color][color=#0000bb]MouseEventArgs[/color][color=#007700]) [/color][color=#0000bb]Handles Me[/color][color=#007700].[/color][COLOR=#0000bb]MouseMove
        [/COLOR][color=#007700]If [/color][color=#0000bb]e[/color][color=#007700].[/color][color=#0000bb]Button [/color][color=#007700]= [/color][color=#0000bb]MouseButtons[/color][color=#007700].[/color][COLOR=#0000bb]Left Then
            NewPoint [/COLOR][color=#007700]= [/color][color=#0000bb]Control[/color][color=#007700].[/color][COLOR=#0000bb]MousePosition
            NewPoint[/COLOR][color=#007700].[/color][color=#0000bb]X [/color][color=#007700]= [/color][color=#0000bb]NewPoint[/color][color=#007700].[/color][color=#0000bb]X [/color][color=#007700]- ([/color][color=#0000bb]X[/color][COLOR=#007700])
            [/COLOR][color=#0000bb]NewPoint[/color][color=#007700].[/color][color=#0000bb]Y [/color][color=#007700]= [/color][color=#0000bb]NewPoint[/color][color=#007700].[/color][color=#0000bb]Y [/color][color=#007700]- ([/color][color=#0000bb]Y[/color][COLOR=#007700])
            [/COLOR][color=#0000bb]Me[/color][color=#007700].[/color][color=#0000bb]Location [/color][color=#007700]= [/color][COLOR=#0000bb]NewPoint
        End [/COLOR][COLOR=#007700]If
    [/COLOR][COLOR=#0000bb]End Sub  
[/COLOR][/COLOR]


btw thanks for sharing bro!
}}}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  Retrieve Owner and Form of a Control silverlight 0 183 12-12-15, 05:28 AM
آخر رد: silverlight
  [كود] تأثيرات على Form او على Objects HASAN6.0 4 490 30-11-15, 10:36 PM
آخر رد: Bettayeb
  [مقال] Fun with Windows Forms & Graphics - Spy Form silverlight 1 514 23-06-15, 09:33 PM
آخر رد: silverlight
  إيجاد جميع الكونترول الموجودة في الفورم Recursively Find All Controls in Form silverlight 0 509 26-05-15, 12:31 AM
آخر رد: silverlight
  معلومة ::: How to resize Windows form to fit Windows screen ::: RaggiTech 0 413 06-10-12, 09:53 PM
آخر رد: RaggiTech
  معلومة ::: Open Form As Single RaggiTech 0 374 06-10-12, 09:28 PM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم