NoRepeat=RadioButton.GetChecked("RadioButton1");
RepeatOn=RadioButton.GetChecked("RadioButton2");
RepeatAll=RadioButton.GetChecked("RadioButton3");	
if (RepeatAll==true) then	
nItemsInListBox = ListBox.GetCount("ListBox1");
tSelected = ListBox.GetSelected("ListBox1");
	sJustFinishFile = ListBox.GetItemData("ListBox1", tSelected[1]);
	nFileIndex = ListBox.FindItem("ListBox1", -1, 1, sJustFinishFile);
	nNextFileIndex = nFileIndex+1;	
ListBox.SelectItem("ListBox1", 1);
sFileName = ListBox.GetItemData("ListBox1", 1); 
	sFileName = ListBox.GetItemText("ListBox1", nNextFileIndex);
	result = ListBox.GetItemData("ListBox1", nNextFileIndex);
	ListBox.SelectItem("ListBox1", nNextFileIndex);
CBChecked()		--[[]] 	IsSelected = ListBox.IsItemSelected("ListBox1", 1);
     if     IsSelected and CBChecked1==true then
	 --[[]]MediaPlayer.Stop("MediaPlayer");
     elseif IsSelected and CBChecked2==true then
	 --[[]]MediaPlayer.Stop("MediaPlayer");
	 --[[]]end  
elseif  RepeatOn==true then
--[[]]MediaPlayer.Play("MediaPlayer");		    
elseif  NoRepeat==true then
--[[]]MediaPlayer.Stop("MediaPlayer");--[[]] 
end
--[[ بعد ما ينتهي الفيديو يتم غلق البرنامج او الحاسوب حسب نوع الاختيار ]]
CBChecked()
	RBChecked2 = RadioButton.GetChecked("RadioButton2");--
STOPPED = MediaPlayer.GetState("MediaPlayer")
		if     (CBChecked1==true)and(STOPPED==VIDEO_STOPPED)then
		--[[]]Application.Exit();
		elseif (CBChecked2==true)and(STOPPED==VIDEO_STOPPED)then
File.Open("AutoPlay\\Docs\\Chrono Shutdown\\Chrono Shutdown.exe", "", SW_SHOWNORMAL);--[[]]
Application.Exit();  --[[]]
		end
--------------------------------------------------------------------------
