时间:2021-05-19
效果图:
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;
using System.Runtime.InteropServices;
namespace MyWeather
{
public partial class Form1 : Form
{
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
[DllImport("dwmapi.dll", PreserveSig = false)]
static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);
[DllImport("dwmapi.dll", PreserveSig = false)]
static extern bool DwmIsCompositionEnabled();
public Form1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
if (DwmIsCompositionEnabled())
{
MARGINS margins = new MARGINS();
margins.Right = margins.Left = margins.Top = margins.Bottom = this.Width + this.Height;
DwmExtendFrameIntoClientArea(this.Handle, ref margins);
}
base.OnLoad(e);
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
if (DwmIsCompositionEnabled())
{
e.Graphics.Clear(Color.Black);
}
}
}
}
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
实现效果实现代码htmlHomeWordPressThemesPluginsTutorialsWebDesignResourcesLinksTutorialsH
在Vista系统之后,微软为窗体程序提供了Aero磨砂的效果,如下图。那么用C#如何来实现这种磨砂效果呢?背景为我的桌面那先上代码吧:[StructLayout
实现效果实现代码htmlThumbnailHoverEffectwithCSS3ImagesfeaturedinthisdemoaretheworksofMer
实现效果实现代码importmatplotlib.pyplotaspltfromskimageimportiofile_name='D:/20201211731
说到aero效果很多用户都会懵逼,这是什么东西,其实这是Win7系统上透明的毛玻璃效果,让win7的界面变得更加美观,近来有用户反馈aero效果失效,这要如何修