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 1166 korisnika na forumu :: 61 registrovanih, 5 sakrivenih i 1100 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 20624 - dana 04 Apr 2026 04:18

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: 357magnum, _ivKe, A.R.Chafee.Jr., alberto, alex71, alternator, Asteker, Bo96, Bombarder, Bosnjo, bufanje, Car89, CCCP, Demi87, Df410, Dimitrise93, doom83, Georgius, goxin, hatman, Imperator_Aleksandr_lll, Ivoo, Jeremiah, jopicus, kibihrchak, Kriglord, ladro, Lj_ubo, lopakodo, Lošmi, luka35, mean_machine, milos97, MiroslavD, mm1811, nezavisni mislilac, Pale2025, Pekman, Petar888, Pilence, repac, sap, shadower78, Shilok, Simonsen23, skvara, Smajser, Smor, ss10, Stevan Visoki, suton, Velibor Radoja, Velizar Laro, Vlada78, XBMC, YugoSlav, Zec, ZetaMan, zgoljo, Zorge, 1324