Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Media;
- namespace A_Beat_Pad
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- // Not Needed
- }
- private void Form1_KeyDown(object sender, KeyEventArgs e)
- {
- // Not Needed
- }
- private void button1_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == (Keys.S))
- { // Edit File Location,
- SoundPlayer snare = new SoundPlayer(@"C:\Users\Anguel Esperanza\My Documents\Wave Files\snare.wav");// Wav File Location
- snare.Play();
- }
- // Adds Focus To The Other Buttons When Key Is Pressed
- else if (e.KeyCode == Keys.D)
- button2.Focus();
- else if (e.KeyCode == Keys.F)
- button3.Focus();
- else if (e.KeyCode == Keys.G)
- button4.Focus();
- }
- private void button2_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.D)
- { // Edit File Location,
- SoundPlayer hi_hat = new SoundPlayer(@"C:\Users\Anguel Esperanza\My Documents\Wave Files\hi hat.wav");// Wav File Location
- hi_hat.Play();
- }
- // Adds Focus To The Other Buttons When Key Is Pressed
- else if (e.KeyCode == Keys.S)
- button1.Focus();
- else if (e.KeyCode == Keys.F)
- button3.Focus();
- else if (e.KeyCode == Keys.G)
- button4.Focus();
- }
- private void button3_Click(object sender, EventArgs e)
- {
- // Not Needed
- }
- private void button3_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.F)
- { // Edit File Location,
- SoundPlayer clap = new SoundPlayer(@"C:\Users\Anguel Esperanza\My Documents\Wave Files\clap.wav");// Wav File Location
- clap.Play();
- }
- // Adds Focus To The Other Buttons When Key Is Pressed
- else if (e.KeyCode == Keys.S)
- button1.Focus();
- else if (e.KeyCode == Keys.D)
- button2.Focus();
- else if (e.KeyCode == Keys.G)
- button4.Focus();
- }
- private void button4_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.G)
- { // Edit File Location,
- SoundPlayer kick = new SoundPlayer(@"C:\Users\Anguel Esperanza\My Documents\Wave Files\kick.wav");// Wav File Lo
- kick.Play();
- }
- // Adds Focus To The Other Buttons When Key Is Pressed
- else if (e.KeyCode == Keys.S)
- button1.Focus();
- else if (e.KeyCode == Keys.D)
- button2.Focus();
- else if (e.KeyCode == Keys.F)
- button3.Focus();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement