Press enter to create playlist. Handle / and \. Clear textbox on create.
This commit is contained in:
@@ -109,6 +109,7 @@ namespace MusicPlayer
|
|||||||
this.PlaylistNewInputfield.Name = "PlaylistNewInputfield";
|
this.PlaylistNewInputfield.Name = "PlaylistNewInputfield";
|
||||||
this.PlaylistNewInputfield.Size = new System.Drawing.Size(225, 20);
|
this.PlaylistNewInputfield.Size = new System.Drawing.Size(225, 20);
|
||||||
this.PlaylistNewInputfield.TabIndex = 5;
|
this.PlaylistNewInputfield.TabIndex = 5;
|
||||||
|
this.PlaylistNewInputfield.KeyUp += new System.Windows.Forms.KeyEventHandler(this.PlaylistNewInputfield_KeyUp);
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -120,7 +120,11 @@ namespace MusicPlayer
|
|||||||
|
|
||||||
private void PlaylistNewButton_Click(object sender, EventArgs e)
|
private void PlaylistNewButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
pl.MakeNewPlaylistByName(PlaylistNewInputfield.Text);
|
string name = PlaylistNewInputfield.Text;
|
||||||
|
PlaylistNewInputfield.Text = "";
|
||||||
|
name = name.Replace('/', '-');
|
||||||
|
name = name.Replace('\\', '-');
|
||||||
|
pl.MakeNewPlaylistByName(name);
|
||||||
Repopulate(true);
|
Repopulate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,5 +137,13 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
SearchAllSongs(FilterTextBox.Text);
|
SearchAllSongs(FilterTextBox.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PlaylistNewInputfield_KeyUp(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if(e.KeyCode == Keys.Enter)
|
||||||
|
{
|
||||||
|
PlaylistNewButton_Click(sender, new EventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user