Click here to Skip to main content
12,761,248 members (29,636 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#

I have a kiosk that has 2 monitors.
I want to display a GIF image on computer startup on one of the monitors to run an ad.
How can I program that in C#?
How can I run the image on a specific monitor?
Posted 12-Aug-13 10:12am
Zoltán Zörgő 12-Aug-13 15:14pm
What do you exactly mean by "computer startup"?
maulikdusara 12-Aug-13 15:15pm
Did you set you graphics display settings to Dual-view mode?
Sandra Ha 12-Aug-13 15:23pm
When the computer completes booting
Zoltán Zörgő 12-Aug-13 15:26pm
You mean when Windows is also loaded, and normally you should see the desktop? You want to start an application automatically after Windows started? Because you can hardly start something before that point - well, you could but it is really-really complicated.
Sergey Alexandrovich Kryukov 12-Aug-13 16:40pm
First of all, you need to tag the UI library or application type you want to use. What does it mean, "run an image"? :-)
"How can I program" is not a valid question. Who knows how you can program it (probably, badly :-)? You need to explain your specific concerns.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Before work with multiple monitors you need to have some knowledge about Screen[^] class. To display any screen on other monitor you need All active monitors Screen Resolutions.

For Retrieving the screen resolution, you're going to want to use the System.Windows.Forms.Screen[^] class. The Screen.AllScreens[^] property can be used to access a collection of all of the displays on the system, or you can use the Screen.PrimaryScreen property to access the primary display.

For setup your application on window's startup please refer below links.[^][^][^]
You also can refer Dynamic Screen Resolution[^] article.
Sandra Ha 12-Aug-13 15:33pm
Actually I read about this class and I used the AllScreens() method to get the monitors details. But I was stuck, I need to display the gif image on one of the monitors in the list I have.
maulikdusara 12-Aug-13 15:44pm
can you post your code what you had done?
Sandra Ha 12-Aug-13 15:49pm
Ok, i made a small windows application just to test. I added a combobox and filled it with the monitors I have. foreach(Screen screen in System.Windows.Forms.Screen.AllScreens)


In this way the user will select a specific monitor.

the second step is to run an image on the selected monior.

Let's say I have the image path , I can't see any method for the screen that says display or show
maulikdusara 12-Aug-13 16:08pm
Ok, below code will help you.

private void Form1_Load(object sender, EventArgs e)
//Fill all screens in drop down list
foreach (Screen item in Screen.AllScreens)

private void btnConvert_Click(object sender, EventArgs e)
//Rectangle object for selected screen
Rectangle recSelScreen = new Rectangle();
int intLeft = 0;
foreach (Screen item in Screen.AllScreens)
//Match if selected screen is current screen
if (item.DeviceName == cboScreens.SelectedText)
recSelScreen = item.WorkingArea;
intLeft += item.WorkingArea.Width;//Need to get left of selected screens

this.Left = recSelScreen.Left; //move current form to selected screen
Sergey Alexandrovich Kryukov 12-Aug-13 16:41pm
This would be good if we knew that OP wanted to work with System.Windows.Forms, but how do we know that?

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 12 Aug 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100