关于WPF 3.5(VS2008)中的窗口或关于框

时间:2010-08-05 05:22:14

标签: wpf about-box

我正在寻找关于WPF VS2008的窗口。任何源代码都可以下载,或者必须自己开发。

谢谢你, 戒日

3 个答案:

答案 0 :(得分:5)

您可以尝试此WPF About Box (CS)。如果您希望从Assembly中动态获取版本作者等,请尝试this blog

Sample WPF AboutBox

答案 1 :(得分:4)

只需创建一个普通的WPF窗口,使其看起来像一个关于框(添加产品名称,版本,版权的文本块......)

WinForms about框没有什么特别之处,它只是预装了常见的框控件的普通形式,没有理由在WPF中使用它。

答案 2 :(得分:1)

微软为VS2010提供了一个gee-whiz WPF AboutBox(作为一个可下载的控件,而不是产品)但是上次我看起来(约一个月前)VS2008中没有这样的野兽。

我最终只是创建了一个WinForms(从向导),它运行良好。然后我发现我可以简化它只是使用硬编码值,因为我不需要任何基于变量的东西:

<强> AboutBox1.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

namespace Dodgy {
    partial class AboutBox1 : Form {
        public AboutBox1() {
            InitializeComponent();
            this.Text = "About Dodgy Thing";
            this.labelProductName.Text = "Dodgy Thing";
            this.labelVersion.Text = "Version 1.0";
            this.labelCopyright.Text = "Copyright 2010. All rights reserved.";
            this.labelCompanyName.Text = "Dodgy Brothers Software GmbH";
            this.textBoxDescription.Text
                = "Dodgy Thing allows you to do all sorts of dodgy things.";
        }
    }
}

要调用它,只需使用:

AboutBox1 about = new AboutBox1();
about.ShowDialog();

我没有包含向导中的样板文件AboutBox1.Designer.csAboutBox1.resx,因为尝试让我意识到SO对答案有30K的限制(并且它们非常粗糙)。你应该只使用向导给你的东西。