.net - Not Checking For Control Key Pressed Properly?
Apr 5, 2011
I got this timer tick function: Private Sub controlTick(ByVal sender As Object, ByVal e As EventArgs) Label2.Text = (Control.ModifierKeys = Keys.Control) End Sub
That is supposed to make my label say "True" if I am currently holding down the Control key, and "False" if I am not.But, how come my label is always "False"? What is interesting is that if I press the Control key at lighting speed a bunch of times I can see for a fraction of a second "True", but immediately turns to "False".
Timer ticks every 50ms.
View 3 Replies
ADVERTISEMENT
Apr 14, 2010
Im doing a small project in visual basic which involves lighting up leds through the parallel port and turning them on and of. each led is controlled by a checkbox on my form and they only come on when the checkbox is checked.
what code do i need to use to have the checkbox checked when a key is pressed but when the key is released the checkbox is unchecked i have already tried keydown which will check the box when a key is pressed but will not uncheck it when the key is released
If e.KeyValue = Keys.A Then
CheckPin1.CheckState = CheckState.Checked
ElseIf e.KeyValue <> Keys.A Then
CheckPin1.CheckState = CheckState.Unchecked
End If
View 4 Replies
Dec 30, 2010
I am writing an application and I want to be able to have it check for updates. When someone presses a button. (Note: I am using Visual Studio 2010, and the application is in VB.NET 4.0)
View 5 Replies
Apr 10, 2011
How do I check if Control + Z is being pressed?
I managed to check for when one key is being pressed, but apparently I can't check for two at the same time.
View 1 Replies
Feb 9, 2010
I am working on an application and I need urgent help. One of my forms contains a web browser. I need to detect if F3 key is pressed while the web browser is active, so a dialog box will appear for a particular functionality of the application. But unfortunately web browser control does not have keyup, keydown or similar event to help me detect if the F3 key is pressed. As far as I know, one way to solve this problem is adding a menu which has F3 shortcut. But my application does not contain any menus, so I dont want use a menu in this part of the application.
View 1 Replies
Aug 14, 2008
How can I set a button, so that when it is pressed, it stays in the pressed down graphic state. Then when pressed again it returns to the normal not-pressed visual.Make a button stay like this until pressed again: url....
View 3 Replies
Jun 21, 2010
how to detect which keyes are pressed on an infrared MCE remote control? I'm a n00b, I've searched google, and can't find anything in VB.
View 1 Replies
Oct 17, 2011
I have a TextBox and set the MiltiLine property to true and AcceptsTab property to false.When the TextBox has focus and i press Tab it works fine and the next control get the focus, but when i press Ctrl+Tab it works as if AcceptsTab property is set to true and makes a tab character into the TextBox.The reason i press Ctrl+Tab.. when switching between forms in my MDI application.Now how to make a Ctrl+Tab when pressed works like Tab when pressed in a MultiLine TextBox?
View 1 Replies
Dec 12, 2010
But I am facing problem Incase of vb .net .I am not able to add Ocx Control what should I do,
View 3 Replies
Oct 30, 2010
I'm making my own winforms button, mainly to be able to control more aspects of a regular button. So far, I've figured out how to control the looks of the button properly, but now I need to implement the changes I've made. I can draw what I have so far, but it flickers even with double buffering...
Inherits System.Windows.Forms.Button
Protected Overrides Sub OnPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(pevent)
[code]....
So far I just want to get my gloss working.I'd also like to know how to control some of the more tedious properties of a button, such as corner radius and how I can make the flatstyle of the button "Flat" all the time without the option to change it (this is so that I don't have to worry about borders and stuff).
View 1 Replies
May 28, 2009
I am working on an inventory managment project for a lumber mill. I am currently writing a piece of software to be used on the sorting section of the mill. The problem I am having is when a stick of lumber needs to be cut down in lengt. My current setup has a combo box that is populated with lengths of lumber that we might have (2' - 60'), a "Add" button and a data control (homemade solution with lots of labels, and panels).
The user will scan a tag into the system, and the system pulls up the info from the db. If the piece need to be cut, the user will select the length of the cut, and click the add button. The system will then populate the first line of the data control with the info from the cut (previous piece info, and new length). It also populates a pieceObject struct. This happens for any additional cut that might happen.
The problem I am having is that everytime I press the "Add" button, the length variable will update every length in the piece array.
Here is a section of the code I am dealing with.
piece is a lumberPiece, and pieceAry is a array of 15 lumberPieces
Each time the add button is pressed, the current data is stored into the array, and then the pieceNum is incremented.
[code]...
View 4 Replies
Feb 11, 2010
I'm working on a game for school, and having a bit of trouble getting keys to control movement properly. When I press down the correspondant arrow key to move the picturebox, it moves the picturebox once, then stops, waits, and then starts moving again continuously (like when you hold down a key in a word processor and it stalls for a bit before repeating the character).the code I'm currently using to move the picturebox is (moving it left as an example)
Private Sub Form1_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyCode = Keys.Left Then
Dim x, y, x2 As Integer
[code]....
how to remove the delay and head straight into the consistant movement?
View 4 Replies
Aug 31, 2009
I have tried function like htmldocment.setAttribute() and webbrowser.document.body.style="font-size:34px"
it's not always working, why?
for example
Dim a As HtmlElement
a = wb.Document.GetElementById("tableID")
a.SetAttribute("border", "3px")
[Code]....
View 3 Replies
Aug 31, 2009
I have tried function like htmldocment.setAttribute() and webbrowser.document.body.style="font-size:34px"
it's not always working, why?
for example
Dim a As HtmlElement
a = wb.Document.GetElementById("tableID")
a.SetAttribute("border", "3px")
[Code]....
View 4 Replies
Sep 25, 2011
this is my code
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
TextBox1.Text = ""
TextBox1.Text = WebBrowser1.DocumentText
Call baby()
End Sub
[Code]...
View 5 Replies
Jun 12, 2011
I am trying some Uiculture change functionality. In that I need the name and text of controls in a form to change the culture. I got some Demo project and it is in C#. I tried to make the same functionality with the C#.net and Also using VB.net. But the below mentioned code returns control name with an underscore as prefix. But I don't want underscore. Code is actually written in Class library. It works perfectly in C#.
Code is written below
Dim fields As FieldInfo() = form.[GetType]().GetFields(BindingFlags.Instance Or BindingFlags.DeclaredOnly Or BindingFlags.NonPublic)
View 1 Replies
Jun 22, 2010
I am looking for a code snippet which opens a image, creates a clone of this bitmap in memory disposes this opened image so that all handles are closed.
Usually we can open a bitmap using this[code...]
the following code however keeps the Image File locked until the application is running, any suggestions how to dispose it properly. (So that no handle is left open )
Things i already tried: use dispose method of bitmap <= doesnt work (need to write implementation)
Using Block also doesnt work.
View 2 Replies
Sep 3, 2009
Checking User control's properties?
View 4 Replies
Aug 13, 2011
I need to find a Windows forms Text edit which can handle MS Word documents correctly.That is documents with Images, textboxes etc (.doc, .docx).I have tried Devexpress Xtrarichedit and TXText Control but when you load a MS Word Document (.doc, .docx) the document does not appear as it does in MS Word.That is Textboxes overlapping images are misaligned or have no transparent background option, so the white background of the textbox hides part ot the image.Has anybody had experience with 3rd party Document .net editors which mamage MS Word Documents correctly?
View 3 Replies
Apr 13, 2011
I am being forced to us Option Strict in my class and this is a new feature to me. Right now my code is having trouble comparing the current time to be added (A Date) with the list of times (Object). Here is my complete code
Option Strict On
Public Class schedulebookForm
' handles Add button user event
Private Sub addButton_Click(ByVal sender As System.Object, _
[Code]....
Problem is inside TimeTaken Function, inside the For.. Until. Basically the If... Then Statement. I tried. .contains, Select Case, and a few other alternatives.
View 5 Replies
Aug 8, 2010
Working with a form that has a menu, toolstrip and Crystal Viewer control. I cannot seem to get the viewer to maximize properly without hiding the toolbar of the Crystal Control behind the menu and toolstrip. I've played with the options of Dock and Alignment, as well as autosize and I just can't get it to work.So do I need to handle the sizing myself to do this and position the control where I need it?
View 2 Replies
May 22, 2012
I am using the media player control in my VB2010 project and hit a problem. I want to detect when a user has pressed the "next " button on the media player console.I can use the following code to detect the pause, play, fast forward, etc but I do not see anything that will detect when the "next" button is pressed.
[Code]...
View 3 Replies
Aug 4, 2010
Is there any better performance by checking for a true value like this:
[CODE]..............
Than like this:
[CODE]..............
View 5 Replies
Nov 25, 2009
I have created a calendar in VB which works fine when set to the startup form, but when I use the MdiParent form as the startup form and try to display the calendar by use of a control it just shows all the buttons and labels with no values assigned to them. Its almost as if the Calendar_Load event is not working, or not accessing the methods in my CalendarClass.
View 2 Replies
May 5, 2011
Private Sub ContextMenuStrip_ForDisplay_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip_ForDisplay.Opening
If Utility.IsKeyDown(Keys.S) OrElse Utility.IsKeyDown(Keys.V) Then
[Code]....
I do the above to cancel the menu if S or V is pressed.
I'd like to cancel if ANY key is pressed.
View 6 Replies
Mar 21, 2010
i have a pocket pc that have some special keys and i need detect when a key is pressed in my program. how can i detect the keys that is pressed? i have tested in a textbox change function the box detect all keys except that special keys there is some api to look for alk keys thats is pressed in pocket pc?
View 3 Replies
Mar 31, 2011
I need to check if the SHIFT or CTRL keys are being pressed in my VB.net application? (get a boolean)
View 3 Replies
Feb 4, 2010
How would I check if a key is currently being pressed?
Also how would I detect if a key is pressed without using the KeyDown event. The reason I am not using the keydown event is when the user holds down a key it calls the event, waits a second than keeps calling it. I do not want the wait period if a user is holding down a key.
View 4 Replies
May 20, 2011
All i wish to do is have some simple code, which can detect when the esc key is pressed, (if possible can you point out where i need to change to set it for an other key).
View 5 Replies
Feb 14, 2010
How do I find out if any key is pressed during a certain time?i have a timer to the "certain time" is no problem.But how do I find if any key is pressed?
View 14 Replies