473,574 Members | 5,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.KeyEventH andler(this.For m1_KeyDown);

In the handler I wrote the following code :

private void Form1_KeyDown(o bject
sender, System.Windows. Forms.KeyEventA rgs e)
{
if(e.KeyCode == Keys.Escape)
{
if(null == thread)
{
currentSize = this.Size;
ThreadStart delegateThread = new
ThreadStart(thi s.KioskDisplay) ;
thread = new Thread(delegate Thread);
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.Hid e();
currentForm = (Form)forms[i%4];
currentForm.Sho w();
currentForm.Ref resh();
currentForm.Foc us();
System.Threadin g.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 4740

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

Similar topics

1
4308
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 want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a...
9
12388
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
3058
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 forum, I have learned quite a bit. But that doesn't mean anything when your looking for your first developing gig. 15 years in television...
4
12426
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
1561
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 from the database. Each page shows the first slide correctly and the second slide always shows up as a thumbnail. After the show completes once,...
1
13909
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 problem 1. Please add MsPowerpoint11.0 object present in COM in ur references. 2. Code : -- Dim appPowerpoint as Powerpoint.Application
5
2186
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
2130
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 fine but that slide show takes a lot of time to load and (the place we are running the slide show is white blank page till than) I dont understand...
0
7821
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8083
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8258
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7835
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6487
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3761
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2255
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.