![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/01/2009, 08:02
|
![Avatar de Peterpay](http://static.forosdelweb.com/customavatars/avatar194134_3.gif) | Colaborador | | Fecha de Ingreso: septiembre-2007 Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 17 años, 5 meses Puntos: 87 | |
Respuesta: Desarrollo de aplicación a pantalla completa en el load o en el diseñador de tu form ponle no se una combinacion seria:
- FormBorderStyle=NONE
- WindowsState=Maximized
o apoyarte del api de windows como este amigo para ocultar el taskbar y asi si tener una aplicacion completamente fullscreen.
Código:
/// <remarks> Apache License Information
///
/// Copyright 2008 Chris DiBona
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
/// </remarks>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices; // Important!
namespace FullScreenExample
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern int FindWindow(string lpszClassName, string lpszWindowName);
[DllImport("user32.dll")]
private static extern int ShowWindow(int hWnd, int nCmdShow);
private const int SW_HIDE = 0;
private const int SW_SHOW = 1;
private void full_maximize(object sender, EventArgs e)
{
// First, Hide the taskbar
int hWnd = FindWindow("Shell_TrayWnd", "");
ShowWindow(hWnd, SW_HIDE);
// Then, format and size the window.
// Important: Borderstyle -must- be first,
// if placed after the sizing functions,
// it'll strangely firm up the taskbar distance.
FormBorderStyle = FormBorderStyle.None;
this.Location = new Point(0, 0);
this.WindowState = FormWindowState.Maximized;
// The following is optional, but worth knowing.
// this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
// this.TopMost = true;
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
full_maximize(sender, e);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Important, re-show Show Window, you know, you should probably
// Also add a handler if the app is minimized, or loses focus, otherwise
// Your users will be taskbarless.
int hwnd = FindWindow("Shell_TrayWnd", "");
ShowWindow(hwnd, SW_SHOW);
}
}
}
|