Click here to Skip to main content
15,915,160 members
Home / Discussions / C#
   

C#

 
QuestionHow to delete PDF files after viewing Pin
AndrusM28-Mar-07 5:50
AndrusM28-Mar-07 5:50 
QuestionAdapting form size to content size Pin
sinosoidal28-Mar-07 5:45
sinosoidal28-Mar-07 5:45 
AnswerRe: Adapting form size to content size Pin
Obaid ur Rehman28-Mar-07 7:43
Obaid ur Rehman28-Mar-07 7:43 
AnswerRe: Adapting form size to content size Pin
Arjun "Mjolnir" Bahree28-Mar-07 10:20
Arjun "Mjolnir" Bahree28-Mar-07 10:20 
AnswerRe: Adapting form size to content size Pin
Arjun "Mjolnir" Bahree28-Mar-07 10:21
Arjun "Mjolnir" Bahree28-Mar-07 10:21 
GeneralRe: Adapting form size to content size Pin
sinosoidal28-Mar-07 23:25
sinosoidal28-Mar-07 23:25 
QuestionMaximized child MDI form Pin
sinosoidal28-Mar-07 5:39
sinosoidal28-Mar-07 5:39 
Questiondisplaying images from a xml file Pin
diducmy28-Mar-07 5:35
diducmy28-Mar-07 5:35 
I am developing an xml playlist(in attribute style) based slide show. I am able to read all the information from xml assign them to variables and then to respective picture boxes and text box. The problem is it waits till the end of the loop to go back to the function that called this process in the form_load method and then display the last file in the play list and exit the loop without ever displaying the first two images

private void Form1_Load(object sender, EventArgs e)
{

CheckForFile(); }


public void CheckForFile() {

LoadPlaylist((System.Convert.ToString(@"C:\PlayerLibrary\config\ab.xml")));

}

public void LoadPlaylist(string strFileName)
{
string strItemName = "";

XmlTextReader playlistReader = new XmlTextReader(strFileName);

while (playlistReader.Read() && (playlistReader.NodeType == XmlNodeType.Element || playlistReader.NodeType == XmlNodeType.Whitespace))
{

if (playlistReader.HasAttributes && playlistReader.Name == "name")
{
strItemName = playlistReader.GetAttribute("location");
playFile(strItemName);
break;

} } playlistReader.Close(); }


public void playFile(string playFileName)
{
string fileExtention = "";
fileExtention = playFileName.Substring(playFileName.Length - 3, 3);


//check if the file is image type then display it using pBoxPlayer
if (fileExtention == "bmp" || fileExtention == "jpg" || fileExtention == "JPG" || fileExtention == "BMP" || fileExtention == "gif" || fileExtention == "Gif" || fileExtention == "PNG" || fileExtention == "png")
{
this.pBoxPlayer.Load(playFileName);


this.pBoxPlayer.Visible = true;

this.Show();

this.pBoxPlayer.Show();


} } }



sam

AnswerRe: displaying images from a xml file Pin
Martin#28-Mar-07 5:56
Martin#28-Mar-07 5:56 
QuestionXmlSerializer and CDATA Pin
theJazzyBrain28-Mar-07 5:15
theJazzyBrain28-Mar-07 5:15 
QuestionConverting a string to currency format Pin
lee.hallows28-Mar-07 5:09
lee.hallows28-Mar-07 5:09 
AnswerRe: Converting a string to currency format Pin
joon vh.28-Mar-07 5:17
joon vh.28-Mar-07 5:17 
QuestionUsing reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 5:09
Dewald28-Mar-07 5:09 
AnswerRe: Using reference parameters when calling an exposed function from a DLL Pin
m@u28-Mar-07 5:29
m@u28-Mar-07 5:29 
GeneralRe: Using reference parameters when calling an exposed function from a DLL Pin
Dewald28-Mar-07 23:39
Dewald28-Mar-07 23:39 
QuestionGuidance Automation Toolkit or CodeSmith? Pin
wojti28-Mar-07 5:03
wojti28-Mar-07 5:03 
Questioncalling function in parent form from child form Pin
Lordveralix28-Mar-07 4:13
Lordveralix28-Mar-07 4:13 
AnswerRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:22
mvePete O'Hanlon28-Mar-07 4:22 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 4:51
Lordveralix28-Mar-07 4:51 
GeneralRe: calling function in parent form from child form Pin
Pete O'Hanlon28-Mar-07 4:54
mvePete O'Hanlon28-Mar-07 4:54 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 5:13
Lordveralix28-Mar-07 5:13 
GeneralRe: calling function in parent form from child form Pin
Lordveralix28-Mar-07 7:11
Lordveralix28-Mar-07 7:11 
Question[Message Deleted] Pin
pashitech28-Mar-07 3:56
pashitech28-Mar-07 3:56 
AnswerRe: how to find help tools Pin
Judah Gabriel Himango28-Mar-07 4:06
sponsorJudah Gabriel Himango28-Mar-07 4:06 
AnswerRe: how to find help tools Pin
Judah Gabriel Himango28-Mar-07 4:55
sponsorJudah Gabriel Himango28-Mar-07 4:55 

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.