Click here to Skip to main content
14,875,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

How to open any video file on full screen mode using c# .net?

I am using this code for play video but my video is not starting on full screen mode.

private void button1_Click(object sender, EventArgs e)

How can we open in full screen mode by default.
Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer
Pravin.Bhosale01 2-Feb-16 3:32am
are you trying to open video file from desktop application or web(
Agarwal1984 2-Feb-16 3:43am
now, opening my file,
but controls are visible,
I want to hide controls of media player.
i am using this code for run application.

static void Main(string[] args)
string fileName = @"c:\\Wildlife.wmv";
Process p = new Process();
p.StartInfo.FileName = "mplayer2.exe";
//Windows Media Player
p.StartInfo.Arguments = "/fullscreen " + fileName;

I want to hide mediaplayer controls also.

1 solution

Since you are using Process class, this code will run the the media player program that user has associated with AVI files. Media players will have different flags to start in fullscreen mode and that is something you will need to live with.

You can however open the maximized window using Process.StartInfo.WindowStyle property. This is not same as full screen though.

Unless you run a specific media player to play the files, there is very little you could do here. You did mentioned Windows Media Player in the comment but there is no guarantee if this code will run it. If user has, say, VLC player on the system and it is associated with AVI file extension, your code will run VLC player and not WMP.

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