本文整理汇总了C#中WindowStyle类的典型用法代码示例。如果您正苦于以下问题:C# WindowStyle类的具体用法?C# WindowStyle怎么用?C# WindowStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowStyle类属于命名空间,在下文中一共展示了WindowStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GoFullScreen
public static void GoFullScreen(this Window window)
{
if (IsFullScreen(window))
{
return;
}
windowState = window.WindowState;
windowStyle = window.WindowStyle;
windowTopmost = window.Topmost;
windowResizeMode = window.ResizeMode;
windowRect.X = window.Left;
windowRect.Y = window.Top;
windowRect.Width = window.Width;
windowRect.Height = window.Height;
window.WindowState = WindowState.Maximized;
window.WindowStyle = WindowStyle.None;
windowTopmost = false;
windowResizeMode = ResizeMode.NoResize;
IntPtr handle = new WindowInteropHelper(window).Handle;
Screen screen = Screen.FromHandle(handle);
window.Width = screen.Bounds.Width;
window.Height = screen.Bounds.Height;
fullWindow = window;
}
开发者ID:AntZhou,项目名称:AntFramework,代码行数:27,代码来源:WindowExpend.cs
示例2: AddPopupWindow
public void AddPopupWindow(Control _TargetControl, Control _PopupControl, PopupEvent _PStyle,WindowStyle _WStyle, int _width, int _height,bool _ismouseclickhide)
{
PopupContent popup = new PopupContent();
popup.TargetControl = _TargetControl;
popup.PopupControl = _PopupControl;
popup.PType = PopupType.Window;
popup.PStyle = _PStyle;
popup.WStyle = _WStyle;
popup.Width = _width;
popup.Height = _height;
popup.IsMCHide = _ismouseclickhide;
popup.WindowTitle = "";
_PopupControl.Tag = this;
if (popup.PStyle == PopupEvent.Click)
{
_TargetControl.Click += new EventHandler(_TargetControl_Click);
}
else if (popup.PStyle == PopupEvent.Mouse)
{
_TargetControl.MouseEnter += new EventHandler(_TargetControl_MouseEnter);
_TargetControl.MouseLeave += new EventHandler(_TargetControl_MouseLeave);
}
else
{
}
popupList.Add(popup);
_PopupControl.Hide();
}
开发者ID:keep01,项目名称:efwplus_winformframe,代码行数:33,代码来源:Popup.cs
示例3: ToFullscreen
public static void ToFullscreen(this Window window)
{
if (window.IsFullscreen())
{
return;
}
_windowState = window.WindowState;
_windowStyle = window.WindowStyle;
_windowTopMost = window.Topmost;
_windowResizeMode = window.ResizeMode;
_windowRect.X = window.Left;
_windowRect.Y = window.Top;
_windowRect.Width = window.Width;
_windowRect.Height = window.Height;
window.WindowState = WindowState.Normal;
window.WindowStyle = WindowStyle.None;
window.ResizeMode = ResizeMode.NoResize;
window.Topmost = true;
var handle = new WindowInteropHelper(window).Handle;
Screen screen = Screen.FromHandle(handle);
window.MaxWidth = screen.Bounds.Width;
window.MaxHeight = screen.Bounds.Height;
window.WindowState = WindowState.Maximized;
window.Activated += new EventHandler(window_Activated);
window.Deactivated += new EventHandler(window_Deactivated);
_fullWindow = window;
}
开发者ID:jasenkin,项目名称:Jasen.Framework,代码行数:32,代码来源:WindowExtension.cs
示例4: CheckIfWindowStyleIsFullscreen
public static void CheckIfWindowStyleIsFullscreen(WindowStyle w)
{
if (w.Equals(WindowStyle.Fullscreen))
MessageBox.Show("Your windowstyle seems to be \"Fullscreen\".\n" +
"If you want to use this tool, change the\n" +
"Windowstyle to \"Windowed\" or \"Windowed Fullscreen\"\n" +
"to have the best experience!", "Windowstyle");
}
开发者ID:hfenigma,项目名称:AnotherSc2Hack,代码行数:8,代码来源:HelpFunctions.cs
示例5: CreateRadioButton
RadioButton CreateRadioButton(string strText, WindowStyle winstyle)
{
RadioButton radio = new RadioButton();
radio.Content = strText;
radio.Tag = winstyle;
radio.Margin = new Thickness(5);
radio.IsChecked = (winstyle == WindowStyle);
return radio;
}
开发者ID:JianchengZh,项目名称:kasicass,代码行数:9,代码来源:TuneTheRadio.cs
示例6: InitWithContentRectStyleMaskBackingDefer
static void InitWithContentRectStyleMaskBackingDefer(ref IntPtr nativePointer, Rectangle contentRect, WindowStyle windowStyle, SafeNativeMethods.BackingStoreType bufferingType, bool deferCreation)
{
nativePointer = ObjectiveC.LP64 ?
objc_msgSend_initWithContentRect_styleMask_backing_defer_64(
nativePointer, Selectors.InitWithContentRectStyleMaskBackingDefer,
contentRect, (long)windowStyle, (long)bufferingType, deferCreation) :
objc_msgSend_initWithContentRect_styleMask_backing_defer_32(
nativePointer, Selectors.InitWithContentRectStyleMaskBackingDefer,
contentRect, (int)windowStyle, (int)bufferingType, deferCreation);
}
开发者ID:nagyist,项目名称:monoxide,代码行数:10,代码来源:Window.cs
示例7: WindowProfile
public WindowProfile(string title, WindowStyle style, ExtendedWindowStyle extStyle, int x, int y, int width, int height)
{
Title = title;
WindowStyle = style;
ExtendedWindowStyle = extStyle;
X = x;
Y = y;
Width = width;
Height = height;
}
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:10,代码来源:WindowProfile.cs
示例8: CreateMenuItem
MenuItem CreateMenuItem(string str, WindowStyle style)
{
MenuItem item = new MenuItem();
item.Header = str;
item.Tag = style;
item.IsChecked = (style == WindowStyle);
item.Click += StyleOnClick;
if (item.IsChecked)
itemChecked = item;
return item;
}
开发者ID:JianchengZh,项目名称:kasicass,代码行数:11,代码来源:CheckTheWindowStyle.cs
示例9: CreateMenuItem
MenuItem CreateMenuItem(string str, WindowStyle style)
{
MenuItem item = new MenuItem();
item.Header = str;
item.Tag = style;
item.IsChecked = (style == WindowStyle);
item.Click += styleonclick; // 메뉴 생성과 동시에 같은 이벤트를 설정한다.
if (item.IsChecked)
itemchecked = item;
return item;
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:11,代码来源:CheckTheWindowStyle.cs
示例10: SetFullScreen
/// <summary>
/// Sets the window's fullscreen state.
/// </summary>
/// <param name="fullScreen">True for fullscreen, false otherwise.</param>
public void SetFullScreen( bool fullScreen = true )
{
if ( fullScreen == IsFullScreen )
return;
if ( fullScreen && !IsFullScreen )
{
oldState = Player.windowData.Window.WindowState;
oldStyle = Player.windowData.Window.WindowStyle;
}
Player.windowData.Window.ResizeMode = fullScreen ? ResizeMode.NoResize : ResizeMode.CanResize;
Player.windowData.Window.ShowTitleBar = !fullScreen;
Player.windowData.Window.ShowCloseButton = !fullScreen;
Player.windowData.Window.WindowStyle = fullScreen ? WindowStyle.None : oldStyle;
Player.windowData.Window.WindowState = fullScreen ? WindowState.Maximized : oldState;
IsFullScreen = fullScreen;
OnFullscreenChanged?.Invoke( this, new OnFullscreenChangedEventArgs( IsFullScreen ) );
}
开发者ID:Wolf-Code,项目名称:Videre,代码行数:24,代码来源:ScreenComponent.cs
示例11: GoFullscreen
/// <summary>
/// 进入全屏
/// </summary>
/// <param name="window"></param>
public static void GoFullscreen(this Window window)
{
//已经是全屏
if (window.IsFullscreen()) return;
//存储窗体信息
_windowState = window.WindowState;
_windowStyle = window.WindowStyle;
_windowTopMost = window.Topmost;
_windowResizeMode = window.ResizeMode;
_windowRect.X = window.Left;
_windowRect.Y = window.Top;
_windowRect.Width = window.Width;
_windowRect.Height = window.Height;
//变成无边窗体
window.WindowState = WindowState.Normal;//假如已经是Maximized,就不能进入全屏,所以这里先调整状态
window.WindowStyle = WindowStyle.None;
window.ResizeMode = ResizeMode.NoResize;
window.Topmost = true;//最大化后总是在最上面
//获取窗口句柄
var handle = new WindowInteropHelper(window).Handle;
//获取当前显示器屏幕
Screen screen = Screen.FromHandle(handle);
//调整窗口最大化,全屏的关键代码就是下面3句
window.MaxWidth = screen.Bounds.Width;
window.MaxHeight = screen.Bounds.Height;
window.WindowState = WindowState.Maximized;
//解决切换应用程序的问题
window.Activated += new EventHandler(window_Activated);
window.Deactivated += new EventHandler(window_Deactivated);
//记住成功最大化的窗体
_fullWindow = window;
}
开发者ID:wuqiangqiang,项目名称:dcs,代码行数:45,代码来源:FullScreenHelper.cs
示例12: WindowDelegate
public WindowDelegate(NavigationWindow window)
{
_window = window;
_dispatcher = window.Dispatcher;
_scenes = new List<Scene>();
_resources = new Dictionary<string, ResourceDictionary>();
_sceneIndex = -1;
_windowRect = new Rect();
_dispatcher.Invoke(() =>
{
_windowTopmost = window.Topmost;
_windowState = window.WindowState;
_windowStyle = window.WindowStyle;
_windowResizemode = window.ResizeMode;
_windowRect.X = window.Left;
_windowRect.Y = window.Top;
_windowRect.Width = window.Width;
_windowRect.Height = window.Height;
window.LoadCompleted += (sender, e) => NavigateFinished();
});
}
开发者ID:WinUP,项目名称:WADV,代码行数:21,代码来源:WindowDelegate.cs
示例13: GoFullscreen
/// <summary>
/// ����ȫ��
/// </summary>
/// <param name="window"></param>
public static void GoFullscreen(this Window window)
{
//�Ѿ���ȫ��
if(window.IsFullscreen()) return;
//�洢������Ϣ
_windowState = window.WindowState;
_windowStyle = window.WindowStyle;
_windowTopMost = window.Topmost;
_windowResizeMode = window.ResizeMode;
_windowRect.X = window.Left;
_windowRect.Y = window.Top;
_windowRect.Height = window.Width;
_windowRect.Height = window.Height;
//����ޱߴ���
window.WindowState = WindowState.Normal;//�����Ѿ���Maximized���Ͳ��ܽ���ȫ�������������ȵ���״̬
window.WindowStyle = WindowStyle.None;
window.ResizeMode = ResizeMode.NoResize;
window.Topmost = true;//��
|
请发表评论