I have a system with 26 buttons but the buttons actaully run the same code; aside from the fact that the index number is used to distinguish between them (es, I know index values are out so I am using the object's name (btnKey1, btnKey2, etc).
Is there any event that occurs for all button presses or do I need to write the same line for all 26 events (actually 52 since I am using MouseDown and MouseUp - will get worse when I want to use the keypress side)?
I'm trying to validate a few things in a form I'm building. It has a datagrid with clients info (taken from an access database) and a few textboxes where the user can type some search criteria. The thing is that those same textboxes are used to add new clients to the database and to modify a client's information if one from the datagrid is selected, so I made it that the buttons to insert and modify clients are disabled on load and thenevery time the text on a textbox changes ("TextChanged" event) they become enabled. So far so good. But then I wanted to make it so when a client from the datagrid is selected both buttons become disabled again until the text on a textbox changes (to make sure they're adding a different client and not the same one that was selected).
I tried using the CellClick event from the datagrid to disable the buttons, but since every time a client is selected from the datagrid the info is shown on the textboxes, this triggers the TextChanged event too, and the buttons become available.So, is there a way I can tell the TextChanged event not to be triggered when the CellClick event occurs?
I have a program that a textbox pops up for 30 sec. What I want to do is this: Have it go away after 30 sec if the user does not enter anything in it and hit return of click the ok button. But if they DO I want the timer to reset back to 30 sec. I have tried disabling and enabling the timer event--- sending a new interval, and spent some time looking in the Forums.
I am currently using Snarl to generate notifications whenever an event / error occurs in my program. How would I go about coding a native VB notification instead of using a 3rd party program?
how to make an event happen when user presses a key ... let's say space or whichever...and the other thing - how to display a folder on my hard disk ("E:Music") in a ListView box in my program?
is it possible to have 2 simultaneous key presses with the keydown event. I have a keydown sub with 2 sets of keys mapped to move 2 different pictureboxes. But when I press a key for the other picturebox, the first one stops moving. How do I get both to work at the same time?
i'd like to know how to make an event happen when user presses a key ... let's say space or whichever...and the other thing - how to display a folder on my hard disk ("E:Music") in a ListView box in my program?
I made a tic tac toe game. and i was wondering how would code it so that when a user presses a button or when a user wins it makes a beep or some kind of music
so my friend and i are working on a project together, he is working on PHP, and im working on visual basic, and we both know what we need to do, but we cant figure out how to use his PHP code and use it in visual basic. What we're doing right now is trying to make a program to send an email to me or him when somebody presses a button. so, how would i use his PHP to send an email from my VB based app? sorry if this is in the wrong place, i wasn't quite sure which to put it in...
I am using timers in a windows service and facing problem that anytime some exception happens ( say i unplug LAN wire from my computer ) service stops running, What i am expecting is that service should keep on running as i am catching generic exception which should catch the exception on one tick event and again work (next tick)when i plug in LAN wire (i am plugging/un plugging ) LAN wire as this service is reading database from LAN so i want to replicate a failover scneario)
How do I use XInput in VB.NET so I can use the Xbox 360 Controller's Rumble feature & get all the button presses, the only examples I found show C++ but I need to access the controller in my VB.NET application...I can't even figure out how to make a reference to XInput to try & start using it or if I need to download something first(if I don't already have it installed.)By what I see a version of XInput comes with windows already in Windows Vista, but I wouldn't know what .dll to look for, where it's located or what references to add or how to use the .dll, like what api's I can use when having added it to my application to use.
how to send e-mail?I don't know what's the code for send e-mail. Can anyone teach me how to?I have a button on the Menu Tool. I want when user presses that button, it will directly link to the Microsoft Office to send e-mail to me.Please teach me.By the way, I also want to know how to load a text file. I want to make another button on the menu tool so when user presses it, a text file will pop up.
One of the problems that I constantly see with Winforms applications is that the GUI thread is stuck while a long-running task is running or just plain stops refreshing (yes, I know - needs threading). Is there a code template/design pattern I can use when reacting to mouse clicks or button presses? Should there be a processing thread always running in the GUI app? Basically, how do I write a great Winforms Application that is easy to maintain and doesn't have any quirky refresh bugs?
A form has many buttons. One of those buttons contains code to update the TableAdapterManager. One of the many TextBox controls has code in a Validating event handler. There is code to make sure a US phone number is formatted properly.If the user tabs out of the TextBox the Validating code works perfectly and show a message to the user if the phone number is not properly formatted and the focus is place in the offending TextBox.If the user clicks on a button that has code to update the TableAdapterManager the Validating code fires but instead of focus remaining on the offending TextBox, the code in the button Click handler also fires.
I would like to stop the button code from firing.Here is the code for the Validating event of the TextBox:
Private Sub TextBoxPrimaryPhone_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBoxPrimaryPhone.Validating ' Make sure the phone is formatted correctly.
[code]....
What additional coding to I need to include so focus remains on the TextBox?
the goal i want to accomplish is when the user presses a button, "moneyamount" increases by a random number generated. the problem i am having is that after the action is finished the script does not seem to save the new value and always starts at zero. here is the script:
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dojob1button.Click
Dim moneyamount As Integer = moneyamount + Int(Rnd() * 10) moneylabel.Text = "$" & moneyamount End Sub
in my form i have 4 textboxes and i want all not to be empty while saving the data.I have put condition in save button,when user presses the save button to save data, to check all the textboxes not to be empty. My question is that, i want to focus to that particular textbox which is empty during saving the data.
For example: i have txt1,txt2,txt3,txt4 as textboxes in the form if txt1 is empty while saving, the focus should switch to txt1 rather user himself have to go there.
I believe there wont be any diff if user clicks the button on the form and the click event is fired OR if we call the button click event / function in the code. Because in one my project, this does make diff. If I click the button on the form, the App works great but same button if I click it thru the form code, the whole process crashes. This happens in Vista / VB.net.
I have created a custom control that has a few labels and a button on it. In my main program i dyanmically add this control to a stackpanel. When i add the control i add a few events for it by doing th e following:
Dim newqueue As New UserControl1 AddHandler newqueue.MouseDoubleClick, AddressOf PrintMessage
How would i go about adding an event for the button.click for the button in the custom control?
i want to call a button click event in any other event like this form key down event.if e.control andalso e.keycode=keys.S then savebuttonclick event should be called end if
i have two asp:buttons.. say button1 and button2, what i would like to do is fire button2's click event when I click button1.. is there a way to trigger click event on an asp:button through code behind? please help, newbie here.
How to catch the event of the window close button(red X button on window right top corner) in wpf form ? We have got the closing event, window unloaded event also, but we want to show a pop up if he clicks the close button of the wpf form.
I am writing a program that expands the usage of the clipboard, but I need to tell when the user has either cut, copied, or pasted something so I can write code accordingly to that. I need to know how I can check to see when the user has entered a command like this.