Read Arrow Key Without Waiting?

Sep 24, 2011

I am practically a beginner at Visual Basic, and programming in general. I have created a simple falling bricks game in Visual Studio 2010. Every 100 milliseconds, it scrolls down bricks and if the player's position hits a brick, the player loses. I am having trouble with input.

I do not know how to make the computer accept left/right arrow keys as input, without having to wait for an input every 100 milliseconds. Here is the code:

Imports System.Threading
Module Module1
Dim RandomN As New Random

[Code]....

If I put "Input()" somewhere in the Animate sub, the program will invariably go wrong. How can I make it work?

View 4 Replies


ADVERTISEMENT

Mouse Cursor Changes Fom "default-arrow" To "waiting"?

Aug 2, 2010

I have a form with some controls on it. I don't know why but now the mouse cursor changes fom "default-arrow" to "waiting" when it is over a controll.

It is so strange since I don't remember changing something that would affect the mouse cursor.

View 3 Replies

VS 2008 Read Multiple Arrow Keystrokes At The Same Time?

Jan 29, 2010

how to read multiple arrow keystrokes at the same time.Like when I have up + left so it should do something like diagonal up-left? I have search the forum to no luck, also tried on keydown, keyup, ProcessCmdKey, etc etc... no good.

View 1 Replies

Recored Arrow Keys And Then Tell Computer To Enter Arrow Keys?

May 23, 2010

So I found this little morpg. The game is fun but really repetitive. I would like to simplify some of the tasks in the game. I do not know how to start this project. How can I recored arrow keys and then tell the computer to enter the arrow keys? One of the objectives in the game is to run around a farm 2x and scare away any wolfs. So the commands would be "arrow key up" for 30sec and then "arrow key right" for 4 sec and repeat. I have worked with robots in real life for some time. We would fill arrays with such instructions. One of the most fun things to program! But I have no idea how to do this in VB.

View 12 Replies

Game Programming :: Detecting Whether One Of The Arrow Keys Is Pressed, All The Other Keys Seem To Be Detected Apart From The Arrow Keys?

Oct 21, 2008

I have a problem detecting whether one of the arrow keys is pressed, all the other keys seem to be detected apart from the arrow keys??? I have set key preview to True........ It detects the arrrow keys BUT ONLY if I have NO other controls on the form??? example..

Me.Text = e.keycode

It works, but then if I add a button for example, it stops.

View 3 Replies

Program To Display The Text "Waiting For Connection..." While The Program Is Actually Waiting For A Connection?

Aug 10, 2010

I want the program to display the text "Waiting for connection..." while the program is actually waiting for a connection. However, when I run the program, the form doesn't even appear because the TCPListener is waiting. What can I do to have the program appear and show the text while it's waiting for a connection?

Imports System.Net.Sockets
Imports System.IO
Public Class frmMain
Dim client As TcpClient

[code].....

View 5 Replies

Make A Waiting Gif?

Dec 15, 2011

How to Make a Waiting while Processing? I mean I want when the software processing login into my Online database, the Button1,TextBox1,TextBox2, LinkLabel1,LinkLabel2 will hide and the Waiting Picture is show,

Here is my code :

Button1.Visible = False
Button2.Visible = False
TextBox1.Visible = False

[code]....

But when i click the button 1, the Button1,TextBox1,TextBox2, LinkLabel1,LinkLabel2 there hide and PictureBox1 Show when MsgBox show "LoginFailed! Invalid Username Or Password" I wanna make the Button1,TextBox1,TextBox2, LinkLabel1,LinkLabel2 hide and picturebox1 show after that Process the Login Verification Into database.

View 2 Replies

Waiting For External EXE To End Before Doing More

Apr 23, 2011

I keep trying different things I find on the net, but I can't get VB.net express to wait for exit. Hopefully someone can point me in the right direction here. Here is my code and all of this works but there is no way to tell when mugen stops.

[Code]....

View 6 Replies

Waiting In Vb2008 / .net?

Aug 21, 2011

I am a VB6 coder and I'm making the move to VB8 / VB.NET.I know how to wait in VB6, but my problem is that I don't know how to wait in VB8/VB.NET. I have a TextBox called textbox2 that contains the number of seconds I want to wait. I used to use wait 60 in VB6, but of course VB2008 is different.

View 5 Replies

Waiting Without The Use Of Timers?

Jun 5, 2009

basically what im doing is something similar to this;

Private Sub FirstRoutine()
'This is my first routine, i load a listbox up with a whole
heap of info

[code].....

View 3 Replies

Create A Waiting Progressbar?

Nov 16, 2011

I have a question, can I make a progressbar like this with code?

View 1 Replies

Restarting The Program And Waiting?

May 8, 2012

is there a function that makes the program wait? and is there something that makes the program restart itself?

View 6 Replies

Waiting For A Thread To Finish?

Mar 11, 2009

I am trying to make a marquee progress bar run while my long function is running. When the function is done running, I want the progress bar to disappear.

[code]...

If I don't do t.Join(), the progress bar disappears right away and then the thread runs. If I do Join(), the progress bar doesn't appear until the message box pops up after the thread is done!How would I get the effect of the progress bar running while the thread is running and then stopping when it's done?

View 15 Replies

Waiting For Auto-login?

Aug 22, 2009

I am writing an application to perform an automated task on a website. I am trying to write a script that logs into the website, then loads a certain page. I have to execute a javascript function after filling in the username and password on the login, but the WebBrowser object doesn't wait and does not log in. As a result, it loads the next page while not logged in. How can I wait until the application logs in before loading the next page? I tired using

Code:
Do While WebBrowser1.ReadyState < 4
Application.DoEvents()

[code]....

View 11 Replies

Waiting For Process To Start?

May 5, 2009

I have a problem with an App I am writing that lists information about various media on your computer and lets you launch it right from the app. My problem is, when launching an intensive process, like a game for instance, it is desirable to shut down the app to not hog precious resources. Here is the code i have so far...

[Code]...

This code works fine, but for one small detail. The app exits before the desired process starts, thus cancelling out the process all together. My question is, how do I get the app to wait for the process to start before exiting?

View 3 Replies

Waiting For Webpage To Load?

May 18, 2009

I'm trying to find out how to wait for the page in my WebBrowser control to finish loading before it runs the rest of the code?When a button is clicked, i want to navigate to a website, then wait for that page to load fully before then processing the other processes.[code]Can i use the DocumentCompelete event, if so how would i use that?

View 2 Replies

Waiting Function Before Going To Next Line

Aug 19, 2010

I am coding a desktop monitoring system,which the server send a keyword to client,then the client will reply with the information and the screenshot. my problem is when the client receive the request message ,in that instance the client will capture the screen and then send the pic,there isa GDI+ error,which i think because while saving the captured picture,it will send the file.How can I instruct the program to finish saving the file before sending the image... this my code :

[Code]...

View 4 Replies

Developing A Patient Waiting Queue In VB?

May 11, 2011

I would like to develop a queue application in VB for a clinic, so that when a patient comes, he is entered in a queue as he waits. A doctor picks the next available patient in the queue and a message is posted in the screen for that patient to go to the doctors room. How do i do this?

View 21 Replies

How To Show The Waiting Wheel Of Vista

Jun 29, 2009

how do you show the vista waiting wheel close to the mouse ( in a wpf application)

View 1 Replies

Show Waiting On Form Return

Dec 15, 2011

What is the proper way to call up a form and wait until it receives a replay before moving onto the next code step? [Code] Now lf is the login form that waits for the users password and then, depending on if its correct or not when they hit OK it should send back a true or false (isLogedIn). Currently i do not know how to have the code wait until it receives something from the login form before moving onto the next code.

If i use my old code here:

Do Until isLogedIn = True
isLogedIn = isLogedIn
intX = intX + 1
Loop

It never ends if the user puts in a false login password so it just keeps waiting.

View 1 Replies

Suspend A Thread While Waiting For Event?

Jul 1, 2011

I am trying to use a separate thread to handle specific events in VB.Net. The idea being that I do not want the main application to be held up if a particular event handler takes awhile to finish. How do I get my main thread loop to suspend the thread while allowing it to handle events when they occur?When I create a Windows Forms application, there is a UI thread that handles the UI events. I do not imagine that this thread is continuously polling some variable to see if someone has pressed a button. I imagine the thread is suspended until the OS tells it there is something to do. I was trying to figure out how to ensure that my event handlers were not being executed by the UI thread. From what I have read, I can do this by raising the events from a different thread. But what does that thread do while it is waiting for other events, just exit?

I wanted to know how to create a thread that works like the UI thread, only it processes the events I want it to process. I am not sure how events work in .Net. I understand that event handlers are run on the thread that raises the event. I believe that .Net allocates threads from some thread pool to process events such as timer events. I am not clear on how it works, though, and what those threads are doing when they are not handling events.

View 2 Replies

The Timer Is Not Waiting That Time After The First Visit?

May 7, 2011

I have a basic question about timers, that I can't answer myself. It's annoying me. My code is made to visit a website every X seconds. There are two problems.

I Set the interval for 30 sec and the first visit should be right now, not after 30 seconds.
After that, wait 30 sec and navigate to another one (in a listbox). The problem is that the Timer is not waiting that time after the first visit.[code...]

View 2 Replies

Vb2008 Waiting For Webpage To Load?

Mar 11, 2010

I am writing a program that loads a web page then get data from the page for calculations. I can navigate to the web page but the code does not wait for the page to completely load before proceeding. I need a way to have the program wait for the page to load before proceeding.

View 2 Replies

VS 2008 Waiting For A Specific Time Of Day?

Jun 12, 2009

Recently in a couple of my current projects I have found that I have the need to 'schedule' events in my applications. For example, I would like something to happen in my program at 11 PM every day (and no I dont want to use Windows Scheduled Tasks) but I cant think of a good way to do this... The only method I can think of is to just have my app check every minute to see if the current system time is 11 PM but obviously that is pretty rubbish. I considered using Windows WorkFlow but that seems very overkill just to do this one thing...

Oh and if it makes any difference, I would like the user to be able to modify these times that certain events occur.

View 5 Replies

VS 2010 Waiting 500 Miliseconds Then A Letter Appear?

Dec 28, 2010

I have a black form with wihte letters in it. All the letters are each label.Fore xample, label1 is for the letter C, label2 is for A. Now I want for the form loading to make label1 appear, then wait 500 miliseconds, then label2 appear, then keep waiting 500, then appear. etc. that's 15 labels.so I did

[Code]...

View 11 Replies

VS 2010 Waiting For Webbrowser To Finish?

Sep 30, 2010

I need to let my webbrowser finish loading before continuing. the problem is, i have the stuff that needs to be done in a do loop, so i can't use documentcompleted.

i currently have

Form2.wb.Navigate(url)
While Form2.wb.IsBusy = True
'do nothing
End While

to check if the webbrowser is loading, but it doesnt really work.

View 5 Replies

Waiting For A Webbrowser Frame To Load?

Feb 28, 2010

i'm trying to make the program wait while the webbrowser document frame loads. I'm using the code below, but all that happens is the page load pauses while the do loop happens (which obviously will be neverending as the search function searches for a line of html particularly present in the page i'm waiting for the webbrowser to load).

[Code]....

View 3 Replies

Waiting List With Arrays & Listbox?

Jan 3, 2010

I am making a project (Waiting List) where I am using arraylist(2) therefor I am entering 3 pieces of information.The information in the arraylist is then sent to a listbox

[Code]...

View 4 Replies

Waiting On A Lock With An Adodb Recordset

Feb 8, 2011

I have a vb program accessing a table in an sql server database. I would like the vb program to wait if it attempts to update a row which is locked in the table. The default behaviour of the recordset seems to be fail immediately with a timeout if the record it wants to update is locked.

The sql server is set to a default lock_timeout of -1 (infinite I believe). Is there a way to have an ADODB recordset wait on a lock (say for 60 seconds) and then fail if it still can't update the record.

View 1 Replies

.net - Show A Waitcursor While Waiting For A Combobox To Render?

Mar 14, 2012

I have a strange issue when binding a combobox in a WPF window.I am loading a List object, to populate the combobox, through it's .ItemsSource, on Window Load, however, it does not populate.At least, not until the arrow is clicked on. Once the arrow is clicked on, the window freezes up, and after a minute or so, the 4000+ records are displayed in it.Now, the list gets loaded, however, when I click on the combobox it takes awhile for it to render, so how can I show a waitcursor while it is rendering the list?Here's the Xaml for it:

<ComboBox Grid.Column="1"
HorizontalAlignment="Stretch" Margin="3" Name="tUser" VerticalAlignment="Stretch"
DisplayMemberPath="UsersName" SelectedValuePath="UserID" SelectedValue="0"/>

And the code-behind is:

Private Sub CreateTask_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Using New WaitCursor
_LA.Show()
Me.tOrder.ItemsSource = GetOrderList()

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved