Click here to Skip to main content
16,018,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,
How to show multiple questions display in one by one in c# windows application by using timer.
Posted
Comments
Sushil Mate 30-Jul-13 3:16am    
where is your code?
ridoy 30-Jul-13 3:18am    
not a good question.

Prefer you setting the timer interval to ideal time which you want each question be shown.
then in Timer_Tick you must add codes for connecting to list of your Q source.

Regards
-Amir Mohammad Nasrollahi
 
Share this answer
 
Hi,
Here is simple Logic.
From where you get the Questions.if its from DB then return Row Number also ex 1,2,3 like that.
Declare a Global Variable as needTODisplay=1;
In timer check the needToDisplay with the Row Number and display the 1st Question and increment needtoDisplay .Continue increment till the last Question.If LastQuestion Found set the needTODisplay=1;
 
Share this answer
 
Hi,
try this instead of message u can show ur question :
C#
using System.Threading;

// Somewhere in your Form, for example in Form_Load event:
new Thread(new ThreadStart(delegate {
    var d = new setLabelTextDelegate(setLabelText);
    label1.Invoke(d, new object[] { "string 1" });
    Thread.Sleep(3000); // sleep 3 seconds
    label1.Invoke(d, new object[] { "string 2" });
    Thread.Sleep(5000); // sleep 5 seconds
    label1.Invoke(d, new object[] { "string 3" });
})).Start();

private delegate void setLabelTextDelegate(string text);
private void setLabelText(string text)
{
    this.label1.Text = text;
}
 
Share this answer
 
Comments
ridoy 30-Jul-13 3:17am    
good one,+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900