Music When User Presses A Button?
Jun 17, 2011I 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
View 6 RepliesI 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
View 6 Replieshow 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.
View 18 Repliesthe 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'm trying to work out how to detect if the user has pressed an f key I have this so far:
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
Label1.Text = e.KeyChar
End Sub
This detects when the user presses a character key and outputs it via Label1.text, but it doesnt work on all keys?
I want to do a "code" that presses a button by ut self with help of a timer. [code\]...
View 4 RepliesI am writing a function that should sound a beep every two seconds until the user either clicks the mouse or presses any key. The code I have written appears to work for the mouse click, but it ignores keystrokes:
[Code]...
I have an assignment from school where the program is supposed to close when the user presses Alt X.
I have done this using Java but that was a long time ago and I can't remember how I did it. How do you do it in VB?[code]...
i want to make a message box appear when the user presses Alt k (then) Alt e (then) alt j . is this the correct code to use?:
Private Sub form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txt3.KeyDown
Dim intcount As Integer = 0
If e.Alt And e.KeyCode.ToString = "k" Then
intcount = intcount + 1
[code]....
I file ComboBox_SelectionChangeCommitted event when a button pressed or form is loaded.
View 3 RepliesI 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)?
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?
View 7 RepliesI want to create a registry entry when the user presses Alt F6 F6
Could someone give me an example of house to do this?
I'm playing with this code
[code]...
I'm trying to find out a way to detect when ever the user presses CTRL -ALT - DEL or Window + L to lock the PC.The code I'm using is
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If (GetAsyncKeyState(17) AndAlso GetAsyncKeyState(18) AndAlso GetAsyncKeyState(46)) Or ((GetAsyncKeyState(91) Or GetAsyncKeyState(92)) AndAlso GetAsyncKeyState(76)) Then[code]....
However, as soon as the user presses CTRL-ALT-DEL the Windows Security Screen comes up and it is too fast for VB to detect that the keys have been pressed.I did a little reaserch on how to work around this issue and found that a GINA stub can be written which can delay the Windows Security Screen by some time say 2 secs which would be enough for VB to detect that the keys have been pressed.Also disabling Ctrl-Alt-Del through VB does not work because it is too fast for VB and I would like not to disable CTRL-ALT-DEL
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...
View 24 Repliesi am making my final year project in vb.net for data entry i want to make the project more user friendly i use code to change the control focus by pressing 'Enter'(ASCII 13).. and clear the content of current control by pressing 'Esc'(ASCII 27)... in my project one form contains at-least 300 of controls say(t1,t2,t3,t4...)
so in the keypress event of t1 i have writen
if asc(e.keychar)=13 then
t2.focus
elseif asc(e.keychar)=27 then
t1.text=nothing
end if
the code works fine but produce an alert beep when i press ENTER to change the active control...
I want to format my textboxes in such a way that when someone fills in the details in the textbox if they press enter button on the keybord the focus is given to the next textbox that they should fill in .I tried the code below that we used in vb6 but its not working.
View 3 RepliesI am using GDI to draw an image of a character on the screen and I would like to animate the character when the user presses an arrow key. Here is my character
character code
character.DrawImage(My.Resources.Right_Standing, 12, 340, 40, 36)
I am using this method
method
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
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?
View 1 Repliesim trying to make a program that only listens to a few keys that the user presses, and if one of them is pressed, it carries out a specified command.for example, right now,i found a keylogger that could carry out my command, but id rather use something else if possible. right now, i have a timer running this:
For i = 1 To 255
result = 0
result = GetAsyncKeyState(i)[code]....
Then, in the textbox1_textchanged, i search for like if textbox1.text.contains("M") or something.problem with this, is im pretty sure its a keylogger, and i dont want to have to have that. also, it does not work in vista.
Found a solution! (should have researched more throughly!)
Option Strict On
Imports System.Runtime.InteropServices[code].....
Inside a multiline Text Box I want it so that when a user presses Ctrl AND Enter then a new line is entered. But, if they press Enter on it's own, then it acts like the Accept button on the Form. I believe this is how Facebook does it.
Ctrl+Enter=NewLine Enter=Accept
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.
View 13 RepliesOne 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?
View 4 Replieshow do you link up a music file to a button?Basically, when a user clicks on a button in the form, I want it to play a track that 'I' set it to play. I dont want a dialog to come up, letting the user select which track to play, like I've found all over the internet.
View 11 Repliessoo i have some music that automaticly plays when i open aplication
how i stop this music from playing and that it continues playing from where it was stopped from, when the same button is pressed
How can i make the play button disabled if the music is playing in the background and when i hit the stop button, the Play button becomes enabled? And the music in the background is from my resource in a .wav file format.
View 1 RepliesI making an music player with a trackbar who gets oppdated while the music is playing. My problem is that I have to move a the trackbar button.
This is my code:
Dim TotalSeconds As Long = CLng(Form1.Player.TotalTime) ' 274445
Dim CurrentSecond As Long = Form1.Player.CurrentTime ' 10497
' maxp is the maximum x location on my bar
Dim nyp As ULong = CULng(((TotalSeconds / maxp) - CurrentSecond))
TB.Location = New Point(CInt(nyp), 11)
Why is it return INF?
i have a program that on a button click it plays music. when i click to play i recieve a loader lock. can someone tell me why this is and provide me a possible solution?
View 2 RepliesI have some code for me to play music on a button click and im not sure how to choose a file and call it in the code.
CODE:
If i want to allow a user to enter a music Chord like C, and want the textbox to autocomplete....do I use AutoCompleteSource and list every possible chord, or do I use AutoCompleteSouce.FileSystem? And I I use FileSysytem, how do I use it? Do I craete a txtfile for it? What's the best way?
View 4 Replies