(23-08-2022, 14:13)tincho escribió: quitarle el borde al formularioHay pero el problema que no es posible mover la ventana con el ratón.
(23-08-2022, 15:32)vuott escribió: Hay pero el problema que no es posible mover la ventana con el ratón.
(23-08-2022, 17:55)tincho escribió: hay que agregar los eventos del ratón par amover la ventanaUhmmm... puedes agregar este código a tu ejemplo, que adjuntaste aquí.
Private x As Short
Private y As Short
Public Sub Form_MouseDown()
x = Mouse.X
y = Mouse.Y
End
Public Sub Form_MouseMove()
Me.Move(Mouse.ScreenX - x, Mouse.ScreenY - y)
End
(23-08-2022, 20:07)vuott escribió: Uhmmm... puedes agregar este código a tu ejemplo, que adjuntaste aquí.
Para mover la ventana del Formulario con el ratón en tu ejemplo, debes hacer clic precisamente en la parte del Formulario accesible/visible.
Private x As Short
Private y As Short
Private bMove As Boolean = False
Public Sub Form_MouseMove()
If bMove Then
Me.Move(Mouse.ScreenX - x, Mouse.ScreenY - y)
Else
Stop Event
Endif
End
Public Sub Form_MouseUp()
bMove = False
End
Public Sub Form_MouseDown()
x = Mouse.X
y = Mouse.Y
bMove = True
End
Private x As Short
Private y As Short
Private bMove As Boolean = False
Public Sub X_MouseMove()
If bMove Then
FMain.Move(Mouse.ScreenX - x, Mouse.ScreenY - y)
Else
Stop Event
Endif
End
Public Sub X_MouseDown()
x = Mouse.X
y = Mouse.Y
bMove = True
End
Public Sub X_MouseUp()
bMove = False
End
Private x As Short
Private y As Short
Private wn As Window
Private w As Watcher
Private tb As ToolButton
Private ta As TextArea
Public Sub _new()
With wn = New Window As "Wndw"
.W = Me.W
.H = 40
.X = (Screen.AvailableWidth / 2) - (.W / 2)
.Y = (Screen.AvailableHeight / 4) - (.H / 2)
.Border = Border.None
.Background = &D9D9D9
.Show
End With
With Me
.X = wn.X
.Y = wn.Y + wn.H
.Border = Border.None
.Margin = True
.Padding = 5
.Arrangement = Arrange.Fill
End With
For b As Byte = 1 To 4
With tb = New ToolButton(wn) As "Toolb"
.W = wn.W * 0.1
.X = .W + (b * 60)
.Y = wn.H * 0.15
.H = wn.H * 0.8
.Border = Border.Plain
.Background = Color.Yellow
.Text = CStr(b)
End With
Next
End
Public Sub Form_Open()
ta = New TextArea(Me) As "TextA"
w = New Watcher(wn) As "Osserva"
End
Public Sub Toolb_Click()
ta.Text &= Last.Text
End
Public Sub Wndw_MouseDown()
x = Mouse.X
y = Mouse.Y
End
Public Sub Wndw_MouseMove()
wn.Move(Mouse.ScreenX - x, Mouse.ScreenY - y)
End
Public Sub Osserva_Move() ' Cuando se mueve el objeto gráfico "Window" con el ratón...
' ...también se mueve el Form:
Me.Move(wn.X, wn.Y + wn.H)
End