Form drag

Form drag

offline
  • Dr SiGn  Male
  • Stručni saradnik
    Windows
  • Pridružio: 11 Jul 2005
  • Poruke: 1149
  • Gde živiš: Beograd

Kako da u vb.net-u vucem formu kad stavim FormBorderStyle na None Confused
Pozdrav smešak

Dopuna: 12 Nov 2005 11:12

Problem resen Very Happy

Kod:

Dim newPoint As New System.Drawing.Point()     Dim a As Integer     Dim b As Integer     Public ScreenWidth As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width     Public screenHeight As Integer = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height     Private Sub ResizeMe_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ResizeMe.MouseMove         If e.Button = MouseButtons.Left Then             Me.SetBounds(Me.Location.X, Me.Location.Y, (Me.MousePosition.X - (Me.Left)) + 10, (Me.MousePosition.Y - Me.Top) + 10)             FormInfo.Text = "Form Information" & vbCrLf & "Width: " & Me.Width & vbCrLf & "Height: " & Me.Height _                 & vbCrLf & "Form Location: " & Me.Location.ToString & vbCrLf & "Mouse Position: " & Me.MousePosition.ToString             Me.Refresh()         End If     End Sub     Private Sub CloseMe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseMe.Click         Me.Close()     End Sub     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown         a = Me.MousePosition.X - Me.Location.X         b = Me.MousePosition.Y - Me.Location.Y     End Sub     Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove         If e.Button = MouseButtons.Left Then             FormInfo.Text = "Form Information" & vbCrLf & "Width: " & Me.Width & vbCrLf & "Height: " & Me.Height _                 & vbCrLf & "Form Location: " & Me.Location.ToString & vbCrLf & "Mouse Position: " & Me.MousePosition.ToString             newPoint = Me.MousePosition             newPoint.X = newPoint.X - (a)             newPoint.Y = newPoint.Y - (b)             Me.Location = newPoint             'Docks Form top left and right corners             If Me.Location.X < 8 And Me.Location.Y < 8 Then                 Me.Location = New System.Drawing.Point(0, 0)             End If             If Me.Location.X > (ScreenWidth - (Me.Size.Width)) + 8 And Me.Location.Y < 8 Then                 Me.Location = New Point(ScreenWidth - Me.Size.Width, 0)             End If         Else             FormInfo.Text = "Form Information" & vbCrLf & "Width: " & Me.Width & vbCrLf & "Height: " & Me.Height _                 & vbCrLf & "Form Location: " & Me.Location.ToString & vbCrLf & "Mouse Position: " & Me.MousePosition.ToString         End If     End Sub End Class



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
Ko je trenutno na forumu
 

Ukupno su 1001 korisnika na forumu :: 33 registrovanih, 9 sakrivenih i 959 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: _Rade, Avalon015, babaroga, branko7, DeerHunter, Denaya, Dovla, E_Kurir, kolle.the.kid, Krusarac, Kubovac, kubura91, lcc, Lieutenant, mercedesamg, milos.cbr, Neutral-M, nuke92, operniki, Oscar, Primus17, Prometeus, raptorsi, royst33, sap, savaskytec, Srle993, Stanlio, stegonosa, t.mile, USSVoyager, vathra, Zoca