小编Cre*_*rop的帖子

系统图标 - Windows 10 风格

我有使用 SystemIcons 的自定义 MessageBox。问题是它们看起来已经过时了。请参见下图,其中包含警告/感叹号图标。我想设置与顶部 MessageBox 相同的图标。我怎样才能做到呢?

相关问题 - 如何从 dll 中提取系统图标(我已经尝试过 7-Zip 方法和 Resource Hacker,但是无法获取内部图形,但在 Visual Studio 中它显示但排列在文件树而不是缩略图中)。

在此输入图像描述

我在 System32 文件夹中找到了“SecurityAndMaintenance_Alert.PNG”文件,它看起来非常相似,但是边框看起来更薄,如果可能的话,我想设置完全相同的图标。

c# winforms

5
推荐指数
1
解决办法
2152
查看次数

自定义DateTimePicker的边框和按钮

目标是创建类似于此问题的屏幕截图的 DateTimePicker 。

第一次尝试覆盖 OnPaint:

public class MyDateTimePicker : DateTimePicker
{
    private Image _image;

    public MyDateTimePicker() : base()
    {
        SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw |
            ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
    }

    [Browsable(true)]
    public override Color BackColor
    {
        get
        {
            return base.BackColor;
        }
        set
        {
            base.BackColor = value;
        }
    }

    [Category("Appearance")]
    public Color BorderColor { get; set; } = Color.Black;

    [Category("Appearance")]
    public Color TextColor { get; set; } = Color.Black;

    [Category("Appearance")]
    public Image Image
    {
        get
        {
            return _image;
        }
        set
        { …
Run Code Online (Sandbox Code Playgroud)

.net c# datetimepicker winforms

1
推荐指数
1
解决办法
181
查看次数

标签 统计

c# ×2

winforms ×2

.net ×1

datetimepicker ×1