473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create a slide show of multiple forms

Hi!

I have a requirement where I need to display multiple forms one after
the other like a slide show. These are in the same application.

Basicall on selection of a menu item it should start then clicking on
any of th screens or tray icon it should stop.

I tried the following (To start it on pressing escape on form1 and end
it when escape is again
pressed on form1):

this.KeyDown += new
System.Windows.Forms.KeyEventHandler(this.Form1_Ke yDown);

In the handler I wrote the following code :

private void Form1_KeyDown(object
sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode == Keys.Escape)
{
if(null == thread)
{
currentSize = this.Size;
ThreadStart delegateThread = new
ThreadStart(this.KioskDisplay);
thread = new Thread(delegateThread);
running = true;
thread.Start();
}
else
{
running = false;
//thread.Abort();
thread.Join();
thread = null;
this.Show();
}
}
}

The code for the slide show function :

private void KioskDisplay()
{
ArrayList forms = new ArrayList();
forms.Add(this);
forms.Add(form2);
forms.Add(form3);
forms.Add(form4);
this.Hide();
form2.Hide();
form3.Hide();
form4.Hide();

Form currentForm = null;
for(int i = 0;true == running; i++)
{
if(null != currentForm)
currentForm.Hide();
currentForm = (Form)forms[i%4];
currentForm.Show();
currentForm.Refresh();
currentForm.Focus();
System.Threading.Thread.Sleep(2000);
}
}

My Question : 1. Is there a better way of doing it.
2. In my case once I do escape it starts, on
second escape it stops, but
pressing the escape again shows only form1
and other forms don't appear
in the loop only form1 comes and hides others
are not shown.

Any pointers to it will be highly appreciated.

regards,
Rajat Jain

Feb 2 '06 #1
0 4731

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
9
by: Michael Burtenshaw | last post by:
I would like to make a slide show using random images. The problem is my host is 250.com, and they don't support cgi-programs. Is there another way to accomplish random images?
7
by: Rudy | last post by:
Hello All! After working in the television industry, moving to a developing career has been interesting to say the least. 3 years of developing with books, and the help of you fine folks on this...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
0
by: Ed Sproull [MSFT] | last post by:
I have an ASP site (www.elsphoto.com} and I have several pages that have slide shows on them. The home page uses JPGs from a directory and the Family, Wedding and Pets pages retrieve the photos...
1
by: mumbaisalsa | last post by:
hi all, i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... .. please give me a solution to this...
5
by: ZEBEDEE | last post by:
i am creating a powerPoint like software using VB6, and i cannot implement the idea of having a multiple slide in my project,,,, can somebody help regarding my problem,, tnx a lot :)
2
by: vineetbindal | last post by:
Hi all, We have a slide show in a page which shows slids rotating after every 8-10 seconds with some descriptions about them. The problem is if the connection speed is slow then the page loads...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.