Ciao a tutti da Maurizio
Vi scrivo in quanto sono alle prime armi con il mio nuovo pacchetto di programmazione Visual Studio 2022
Ora il mio problema e questo : Io ho inserito in un Form due pulsanti e una una Label
Ora lo scopo di questo progetto sarebbe quella di premere uno dei due pulsanti (Button) e da programma Il form1 si dovrebbe chiudere in senso Verticale molto lentamente.
Io di mio ho provato a scrivere questo codice :
codice:
Imports System.Threading
Public Class Form1
Declare Sub Sleep Lib "kernel32" (dwMilliseconds As Long)
Private Const V As Integer = -1
Dim I
Private Sub NewMethod1()
#Enable Warning IDE0051 ' Rimuovi i membri privati inutilizzati
Throw New NotImplementedException()
NewMethod1()
Sleep()
End Sub
Private Sub NewMethod()
DoEvents()
End Sub
Private Sub Sleep()
Throw New NotImplementedException()
End Sub
Private Sub DoEvents()
Throw New NotImplementedException()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Public Function GetV() As Object
Return V
End Function
Sub Chiudi_In_Modo_Vert(v As Object)
I = Me.Label1.Text & ""
For I = Me.Height To v
Me.Height = I
Me.Height = Me.Height - 1
DoEvents()
Me.Label1.Text = Me.Height & 0
Thread.Sleep(1)
End
Next I
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Call Chiudi_In_Modo_Vert(GetV())
End Sub
End Class
Ma pur non dandomi nessun errore apparente
Il Form non di muove di una virgola.
Potete voi darmi una dritta per risolvere questo problema Grazie
Saluti da Maurizio