Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 21:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB.NET][TuT] Eine Pause realisieren

Discussion on [VB.NET][TuT] Eine Pause realisieren within the Coding Tutorials forum part of the General Coding category.

Reply
 
Old   #1



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,177
Received Thanks: 14,471
[VB.NET][TuT] Eine Pause realisieren

==================================================
==================================================

In diesem TuT zeige ich euch, wie wir eine
Pause in der Anwendung nutzen.

==================================================
==================================================

Die Delay-Funktion werden wir in VisualBasic vergeblich
suchen, und das ist auch gut so, da schließlich Windows
ein Multitasking-System ist.

==================================================
==================================================

• Was wir brauchen
- 2x Buttons (1 = Delay, 2 = Sleep)
- 1x ListBox
- 1x Textbox

==================================================
==================================================

==================================================
==================================================

Als erstes definieren wir die Zeit Funktion.
Variante 1:
Quote:
Private Sub Delay(ByVal Zeit As Integer)
Dim Zeit1 As Integer = System.Environment.TickCount
While (System.Environment.TickCount - Zeit1) < Zeit
Application.DoEvents()
End While
End Sub
Button1:
Quote:
ListBox1.Items.Add("Start")
Delay(Textbox1.Text)
ListBox1.Items.Add("Stop")
Nun ist Sleep an der Reie.
Variante 2-
Button2:
Quote:
ListBox1.Items.Add("Start")
Application.DoEvents()
System.Threading.Thread.Sleep(TextBox1.Text)
ListBox1.Items.Add("Stop")
==================================================
==================================================

Hier nochmal der gesamte SourceCode:
Quote:
Public Class Form1

Private Sub delay(ByVal zeit As Integer)
Dim zeit1 As Integer = System.Environment.TickCount
While (System.Environment.TickCount - zeit1) < zeit
Application.DoEvents()
End While
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add("Start")
delay(TextBox1.Text)
ListBox1.Items.Add("Stop")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Add("Start")
Application.DoEvents()
System.Threading.Thread.Sleep(TextBox1.Text)
ListBox1.Items.Add("Stop")
End Sub
End Class
==================================================
==================================================

Anmerkung:
Quote:
Die Delay funktion ist vorzuziehen, da sie wärend
der NUtzung noch die anderen funktionen zulässt, wohingegen
die Sleep funktion die gesammte Form "schlafen" lässt.
==================================================
==================================================
Credits: Sedrika
Sedrika is offline  
Thanks
7 Users
Old 03/04/2010, 21:29   #2
 
CappieW's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 19
Received Thanks: 1
ich mag deine tutorials, sind sie so organisiert (:
CappieW is offline  
Old 03/04/2010, 21:30   #3



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,177
Received Thanks: 14,471
Quote:
Originally Posted by CappieW View Post
ich mag deine tutorials, sind sie so organisiert (:
Nach so langer zeit eine antwort ^^

Danke =)
Sedrika is offline  
Old 10/05/2010, 14:59   #4
 
elite*gold: 0
Join Date: Oct 2010
Posts: 1
Received Thanks: 0
ich fang grad erst an VB zu lernen, weil wir das auch in der BFS haben (Berufsschule...) und ich davor noch nie was am Hut hatte. Aber der TuT (hoffe das war richtig=)) gefällt mir sehr gut. Leicht nachzumachen und zu verstehen. Btw. man lernt daraus.

mfg

benny
Benjamin.groß is offline  
Old 10/05/2010, 21:25   #5
 
Secredo's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 355
Received Thanks: 106
Quote:
Originally Posted by Benjamin.groß View Post
ich fang grad erst an VB zu lernen, weil wir das auch in der BFS haben (Berufsschule...) und ich davor noch nie was am Hut hatte. Aber der TuT (hoffe das war richtig=)) gefällt mir sehr gut. Leicht nachzumachen und zu verstehen. Btw. man lernt daraus.

mfg

benny
Nein, war nicht richtig.
Es heißt das Tutorial (= TuT).

Sorry, musste sein. xD


MfG Secredo
Secredo is offline  
Reply


Similar Threads Similar Threads
fähigkeitsbuch pause
07/14/2010 - Metin2 - 9 Replies
huhu gibt ja sone pause da.. kann man die iwie durch bug oder so wegmachen? MfG sry es heißt fertigkeitsbuch-.-
Stuck at pause
04/07/2010 - Shaiya - 3 Replies
Hello, I was woundering if i could get help. I am stuck at the pause stage and when i go to change it to the ">" thing they all go but session. And then they all turn back to pause after lil. Any help?
Shaiya pause?
10/21/2009 - Shaiya - 2 Replies
I'm a new player to shaiya and and a big googler. with the fact i can click 3-4 screens away i thought Wow my duel screen set-up would be wonderful to google questions i have with the game. but for some reason my game pauses even with no game guard. it there a fix for this? thank you for your help a head of time and thanks for the wonderful forum.
pause bei autoit
02/25/2009 - AutoIt - 2 Replies
Hi, wie mache ich das mein bot wenn ich auf 0 drücke sich pausiert? habe autoit Mfg Christian



All times are GMT +2. The time now is 21:21.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.