Click here to Skip to main content
15,901,982 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to group...... Pin
0x3c031-Mar-09 6:35
0x3c031-Mar-09 6:35 
Question8 queen Pin
Reza S31-Mar-09 5:33
Reza S31-Mar-09 5:33 
AnswerRe: 8 queen PinPopular
musefan31-Mar-09 5:40
musefan31-Mar-09 5:40 
GeneralRe: 8 queen Pin
Colin Angus Mackay31-Mar-09 5:47
Colin Angus Mackay31-Mar-09 5:47 
GeneralRe: 8 queen Pin
Yusuf31-Mar-09 6:21
Yusuf31-Mar-09 6:21 
AnswerRe: 8 queen Pin
harold aptroot31-Mar-09 5:46
harold aptroot31-Mar-09 5:46 
AnswerRe: 8 queen Pin
Luc Pattyn31-Mar-09 5:57
sitebuilderLuc Pattyn31-Mar-09 5:57 
QuestionWhere i wrong??? Pin
VisualLive31-Mar-09 5:16
VisualLive31-Mar-09 5:16 
Hi i'm getting exhausted about a simple feature but sincerely i don't know how work out that Frown | :(
I have this code to use Window Media Player :

public partial class Form1 : Form
 {

     TextBox textbox;
     public Form1()
     {
         InitializeComponent();
         listBox1.SelectedIndexChanged += listBox1_SelectedIndexChanged;
         textbox = new TextBox { Dock = DockStyle.Top };
         listBox1.SelectionMode = SelectionMode.MultiExtended;
     }

     private void Form1_Load(object sender, EventArgs e)
     {
       List<string> prova =  GetListOfFiles(@"D:\\Torrent\\Depeche Mode - Sounds Of The Universe (2009)\\");

         listBox1.DataSource = prova;
         listBox1.DisplayMember = "prova";
         player1.settings.setMode("Shuffle", true);
         player1.Ctlcontrols.play();

     }

     private List<string> GetListOfFiles(string Folder)
     {
         DirectoryInfo dir = new DirectoryInfo(Folder);
         FileInfo[] files = dir.GetFiles("*.mp3", SearchOption.AllDirectories);
         List<string> str = new List<string>();
         foreach (FileInfo file in files)
         {
             str.Add(file.FullName);

         }
         return str;
     }

      private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
     {
         Text = Convert.ToString(listBox1.SelectedItem);
         player1.URL = Convert.ToString(listBox1.SelectedItem);
     }

     private void textBox1_KeyDown(object sender, KeyEventArgs e)
     {
         if (e.KeyCode == Keys.Return)
         {
             string searchFor = textBox1.Text;
             List<string> strings = (List<string>)listBox1.DataSource;
             if (multi.Checked)
             {
                 for (int i = 0; i < strings.Count; i++)
                 {
                     listBox1.SetSelected(i, strings[i].Contains(searchFor));
                 }
             }
             else
             {
                 listBox1.ClearSelected();
                 listBox1.SelectedIndex = strings.FindIndex(
                     s => s.Contains(searchFor));
             }
         }
     }


 }


With this code i can search songs and show in a ListBox the list downloaded in a folder but my purpose is when Window Music Player change song automatically the ListBoxItem will change marker and show the current song instead now when WMP change song the marker of the listBox did not move .
An important characteristic is the i set the WPM in RandomPlay it is a feature requested.
Do you have any idea how i can work out that from some day i felt a little confuse to find out the right way but not luck.
Have a good luck.

Nice Regards
AnswerRe: Where i wrong??? Pin
Yusuf31-Mar-09 6:24
Yusuf31-Mar-09 6:24 
GeneralRe: Where i wrong??? [modified] Pin
VisualLive31-Mar-09 7:15
VisualLive31-Mar-09 7:15 
GeneralRe: Where i wrong??? Pin
Yusuf31-Mar-09 9:03
Yusuf31-Mar-09 9:03 
GeneralRe: Where i wrong??? Pin
VisualLive31-Mar-09 16:03
VisualLive31-Mar-09 16:03 
QuestionAdhoc networking using windows application in VS2005 Pin
alish061031-Mar-09 5:00
alish061031-Mar-09 5:00 
AnswerRe: Adhoc networking using windows application in VS2005 Pin
musefan31-Mar-09 5:12
musefan31-Mar-09 5:12 
GeneralRe: Adhoc networking using windows application in VS2005 Pin
alish061031-Mar-09 20:17
alish061031-Mar-09 20:17 
QuestionOpenFileDialog Pin
netJP12L31-Mar-09 4:22
netJP12L31-Mar-09 4:22 
AnswerRe: OpenFileDialog Pin
musefan31-Mar-09 4:30
musefan31-Mar-09 4:30 
AnswerRe: OpenFileDialog Pin
Giorgi Dalakishvili31-Mar-09 4:39
mentorGiorgi Dalakishvili31-Mar-09 4:39 
Questionc# 2005 add_In Excel 2003 Pin
sofianeannabi31-Mar-09 4:13
sofianeannabi31-Mar-09 4:13 
QuestionMulti-threading - Parallel Syncronization Pin
caksabre231-Mar-09 4:12
caksabre231-Mar-09 4:12 
AnswerRe: Multi-threading - Parallel Syncronization Pin
Luc Pattyn31-Mar-09 4:54
sitebuilderLuc Pattyn31-Mar-09 4:54 
AnswerRe: Multi-threading - Parallel Syncronization Pin
Ian Shlasko31-Mar-09 5:02
Ian Shlasko31-Mar-09 5:02 
AnswerRe: Multi-threading - Parallel Syncronization Pin
Alan N31-Mar-09 5:17
Alan N31-Mar-09 5:17 
GeneralRe: Multi-threading - Parallel Syncronization Pin
caksabre231-Mar-09 5:37
caksabre231-Mar-09 5:37 
Questionwhy button_click event raising 2 times? Pin
Narendra Reddy Vajrala31-Mar-09 3:43
Narendra Reddy Vajrala31-Mar-09 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.