VS 2010 - Hold Key Down For Only One Second?
Jun 4, 2012So, if this is how to hold a key down for an infinite amount of time:
keybd_event(CByte(Keys.Right), CByte(MapVirtualKey(Keys.Right, 0)), 0, 0)
How can I hold it down for only 1 second?
So, if this is how to hold a key down for an infinite amount of time:
keybd_event(CByte(Keys.Right), CByte(MapVirtualKey(Keys.Right, 0)), 0, 0)
How can I hold it down for only 1 second?
What is the numeric data type that can hold the biggest Integer in VB.NET 2010?
View 5 RepliesI'd like to create a function in my application in Visual basic 2010 that would:Simulate a left-mouse button click+hold and drag with a timer tick eventSet a new XY coordinates for the mouse to drag the item to a new locationRemove the left-mouse button click+hold command
View 1 RepliesI have a vb.net project that has 2 exe's that get built as well as the installer. The two exe's share a bunch of common files. I do not want to have two copies of the common files or mess around with having build events that copy things around (if possible).
My method was to create two projects in the same folder and have them point to the files they needed. This appeared to work until I tried to compile both apps at which point I get an error in a file called Application. Designer.vb. It seems that project files create this file in their folder and when I have two solutions in the same folder they conflict. So my next effort was to create the second project in it's own folder and just add the items as needed. The problem here is that VS2010 doesn't hold a link to a file in a different folder it copies the file to the new project folder. What is the vs2010 way to get this done?
Speed is critical in my application. As of now, I'm using an ArrayList to store a list of Strings and I use BinarySearch functionality of ArrayLists to search for an item. Would I be able to do this faster using String Collection and a for loop?
View 22 RepliesI'm building a new industrial app using MODBUS/TCP talking to a DAQ unit that will have a lot of parameters and will need to be adaptable for different scenarios. For example, the units I'm connecting to have 12 inputs and 6 outputs, mapping for those may be different for each installation, and in one instance I'll be talking to 4 units together - if that's the best way to do it - each one will have identical parameters, just a different ID number and ip address. They will all be writing to a SQL Server database. Not sure if I'm better off having a Tab control with each unit on a separate tab or a different instance of the app for each one. Is one better than the other? The units will be polled every 200-500ms. 500ms seems to be more stable.
With so many parameters, is it better to store all them inside the application and access them through My.Settings or would I be better storing them in a database, either the SQL Server DB or maybe something like SQLite (one of my faves) or is there a better way?
Not done anything quite as big as this before and first time with MODBUS, but that bit is working a treat.
I am writing a program that is going to take two dates (entered by a user) and compare them against each other to determine when something was purchased vs when it was paid for. I'm ok with everything except one part, and its a biggie, how do I have the user enter the dates (format) and how do I convert it from a string to a recognized date format? Does that make sense?
View 4 RepliesCurrently, I use SendKeys.SendWait("{Left}")
How can I hold the left arrow down?
I really want to do this the proper way, it's just that I've been doing it the wrong way for so long, I can't seem to get past it.
in a console app if I start a timer or kick off a thread or bgw, the sub main runs right on thru and the app finishes and closes.
i need the sub main to just hold position until some event is raised then handle the event and come back to sub main or end depending if the event that was raised told us to end or not.
what I would normally use is this:
Do While KeepLooping
Wait(5D)
CheckTimedEvent()
Loop
i have maid a program witch has images in it from my hdd. Now when i build my program and send it to other ppl thay cannot see the images. i know this is becaws the path i directed to pull the images from is not on there pc nor do thay have the images lol. so my question is how do i put the images in the actual exe as in the actual program that i have built so all the images and stuff are all in there. so thay only need to run the exe and not have any sub folders to hold the images.
View 1 Repliesso the way I have this working now I'M using System.Collections.Generic.List(Of T) for holding 100's of a structure.Dim Users as New List(Of User)
I was wondering if there was any better way or faster list container or something like this in the .net framework?
I have over 9,00,000 records in my Access database but only a fraction of that is being displayed in the listbox. How Many Rows Can A Listbox Hold? Around 65K is the answer I got from my research.
View 3 RepliesI am a first year coding student and we are starting out with Visual Basic. Up until now I have been able to figure everything out, but I have run hard into a wall and I don't feel like I've been taught how to get over it. Here's the thing.
First Form
Contains a list box for products selected, and four text boxes for Subtotal, Tax, Shipping and Total.
Second & Third Forms
Each contain a list box of books to select from which will be added to the first form.[code]....
I feel like I am doing it wrong right out of the gate - as you can see I am going by the item that the user chooses, and adding a constant value that I have pre-defined in a module. Then I add the name of the book to the first form - but here's the issue.That text string doesn't hold a value.SO, when I use the remove button on the first form - the text string removes but the subtotal, tax, shipping and total boxes do not change in the least bit because the item that I removed doesn't retain any value.
I like to create a Structure that could hold 'Yes' or 'No' only; just like a Boolean variable could hold True or False.
View 12 Repliesim using XML as my database and uses dataset to hold the xml. which one do you think is better to backup my xml?
1. write the xml to 2 location, default location and the backup location
dataset.writexml(path1)
dataset.writexml(path2)
2. write the xml to default location and copy it to the backup location
dataset.writexml(path1)
copyfile(path1,path)
if you have a better way of doing it please dont hesitate to share it..
I'm trying to make the classic Snake game in VB.NET, but if I hold a key (any key) during the game, after a few seconds the game freezes until I release the key. I've tried lots to fix this, but nothing works, maybe because I don't understand the problem.I'm assuming that when I hold down a key, the Form1_KeyDown function gets called, and when, after a few seconds, the key goes into "I'm being held down" mode, that function is constantly called, so the timers don't get a chance to update. But like I said, I'm probably wrong.
I've been struggling with this for a while. I think this is all the necessary code, please let me know if it isn't.
[Code]...
I have a bit of a problem. I am using an Access database to hold data for my VB app. In the VB app, I have a data source thats pulling data from the database.
I modified the database today, deleted some tables, added another one, but the data source in the project window does not show these updated changes. I had to reconfigure the datasource with the wizard to get the changes to update.
Is there a way that i can get the data source to update itself when the form loads?
I'm not sure if this is a simple problem or not but it's frustrating me to no end.
I'm using the following code to add my data to the database, and then this to refresh. [code]...
I've never come across this before:I have a series of text boxes. The text of these boxes get set on page load. then I have a submit button that calls a sub to update the table with the new values (text) in the text box. The problem is it is keeping the original text not the text that is CURRENTLY in the textbox. Anyone come across this before? Or know how to get round it?
[Code]...
connect my vb.net application to a remote sql server database, so every one who installs the application would be able to connect to the same remote database. the application would obviously require the internet to run.i also want the option to add more databases in the future, preferably one for each business who would use my software.i am wondering the best way to set up this server that could hold multiple databases. i would think i have two options:
1) set up the server myself on a dedicated computer
2) pay for some type of service that host sql server dataases
so how would i go about executing these options? i dont know the first thing. which option is better?i do however know how to connect to a remote database so thats not what i am asking.
what control can hold an html page? vb.net2003 windows app
View 4 RepliesI want to store the contents of an XMl file into an array but struggling to work this out. I have managed to read the data in and store in labels as a test. I then created an array list and used a message box to display the data to see that it has been stored. It does but I am not sure how to group this data. There are 3 records in the file. the idea is to end up with the following:
[Code]...
I would like to know how to declare a variable that holds bits.
View 11 Repliesis there a way i can have a dictionary or something of that sort that can hold 3 values to 1 key?
View 12 RepliesI have an Obout grid that I have been trying to work with and I put all of their code in my site so that I could have my grid stay expanded when the page does an automatic refresh.How or what is the correct way to code for a If (Page.IsPostBack) code.Next is there an online free convertor, translator, for javascript to VB.NET; if not is there someplace that I can go to where they will explain the different meaning of the javascript in comparision to what it would mean in VB.Net (such as var I think means dim or it could mean something else I am not sure.)Final is there a good source on grids and how they work with a view state or a session? But it needs to be basic as I am still trying to understand all three of those processes.
View 5 RepliesAnybody know how to hold a card in poker game?[code]...
View 1 RepliesI have been a programmer for 36 years (COBOL,FORTRAN, etc.) but I am new to VB.NET. I am writing a random quote generator program to teach myself VB.NET. On a context menu of a NotifyIcon I have some main menu items, one of which is "Choose random quote files". When I mouse over the main menu item the sub-menu opens. I can click on one of the filenames that has been loaded from a directory to include (or exclude) it from the population. As soon as I do, the context menu closes. I want the user to be able to click on more than one file name before the menu closes.
View 8 RepliesI need to have a VB form that runs out of focus behind another program. When I press "A" (I'll use "A" and "B" as my example keys), "B" is then sent to the program in focus from the VB form and held until "A" is pressed again.
I've worked out how to get it to repeat a key press hundreds of times but I need it to HOLD the key, rather than to just Press and De-press countless times.Here's the piece of code which repeats the letter "A" 100 times:
Dim Index As Integer 'My count variable
For Index = 1 To 100 'Count from 1 to 100
[code]....
I'm making a timer. To start the timer the user must hold down a button for a certain period of time (0.7 seconds) then the timer will start. I'm having trouble making a code so that the timer starts only when the user hold the button for 0.7 seconds.
View 5 RepliesI have created an alarm program but am having an issue creating multiple alarms. Here is what I have so far. I have created an array to hold multiple instances(10) of alarms that I want to run concurrently.
Code:
Dim SetAlarms(7, 9) As String
Public Shared x As Integer = AlarmNumb
'X=alarmnumb
[Code]....
What I cannot figure out is how to get the program to read the array and recognize each row as a separate alarm to process. This means it must read the array, know which variables to populate with what information and cycle thru the list.