使用XP的外观

sam_ai 2003-08-23 07:26:47
.Net 很好,可是我想使用XP的那种外观. 怎么做呢?
VB,VC++的解决都可以:)
...全文
40 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
szch 2003-08-24
  • 打赏
  • 举报
回复
要么使用第三方控件
要么自己画
否则,使用系统模式,在XP风格下就自动改为对应的外观
snlmgytO 2003-08-24
  • 打赏
  • 举报
回复
有,真的吗,哪里有,vb6的也可以
menuvb 2003-08-24
  • 打赏
  • 举报
回复
网上有这方面的XP样式全部控件,不过我不知道有没有NET的.
snlmgytO 2003-08-24
  • 打赏
  • 举报
回复
我只要在XP下使用XP的按钮、文本框阿
y1g1y1 2003-08-24
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/TopicView1.asp?id=2093334
spiketang 2003-08-24
  • 打赏
  • 举报
回复
主要是增加一些pictureBox然后对它们的又击事件进行编码!
private void changeWinState()
{
if(!ismax)
{
this.WindowState = FormWindowState.Maximized;
ismax=true;
this.TitleLabel.Text = "最大化!";
}
else
{
this.WindowState = FormWindowState.Normal;
ismax=false;
this.TitleLabel .Text = "默认大小!";
}
}

private void picBox_DoubleClick(object sender, System.EventArgs e)
{
changeWinState();
}

private void TitleLabel_DoubleClick(object sender, System.EventArgs e)
{
changeWinState();
}

private void picBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
m_pOffset = new Point(-e.X, -e.Y);
}

private void picBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Left)
{
Point mousePos = Control.MousePosition;
mousePos.Offset(m_pOffset.X, m_pOffset.Y);
Location = mousePos;
}
}

private void button1_Click(object sender, System.EventArgs e)
{
Application.Exit ();
}

private void pictureBox4_MouseEnter(object sender, System.EventArgs e)
{
this.pictureBox4 .Image = System.Drawing.Bitmap.FromFile("close2.bmp");
}

private void pictureBox4_MouseLeave(object sender, System.EventArgs e)
{
this.pictureBox4 .Image = System.Drawing.Bitmap.FromFile("close1.bmp");
}

private void pictureBox4_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox4 .Image = System.Drawing.Bitmap.FromFile("close3.bmp");
}

private void pictureBox4_Click(object sender, System.EventArgs e)
{
Application.Exit ();
}
}
Dugu_Niu 2003-08-24
  • 打赏
  • 举报
回复
把所有控件的FlatStyle属性设为System,注意有的可视控件没有这个属性
然后把下面的代码添加到#Region 区的InitializeComponent()后面(这个需要放在任何初始化代码前面),OK,试着运行一下。
 
Dim x As String
Dim y As Integer
Dim AppName As String
Dim ManFileName As String
Dim AlreadyExists As String
'Find the name of this application
x = Application.ExecutablePath
y = x.LastIndexOf("\")
y = y + 1
AppName = x.Substring(y, x.Length - y)
'Create the name for the XML file
ManFileName = AppName & ".xml"
'See if the manifest exists
If System.IO.File.Exists(ManFileName) Then
AlreadyExists = "Y"
Else
FileOpen(1, ManFileName, OpenMode.Binary)
FilePut(1, "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" & vbCrLf)
FilePut(1, "<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>" & vbCrLf)
FilePut(1, "<assemblyIdentity version='1.0.0.0' processorArchitecture='X86' name='zx.exe' type='win32' />" & vbCrLf)
FilePut(1, "<description>zxapplication</description>" & vbCrLf)
FilePut(1, "<dependency>" & vbCrLf)
FilePut(1, "<dependentAssembly>" & vbCrLf)
FilePut(1, "<assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*' />" & vbCrLf)
FilePut(1, "</dependentAssembly>" & vbCrLf)
FilePut(1, "</dependency>" & vbCrLf)
FilePut(1, "</assembly>" & vbCrLf)
FileClose(1)
'Open a new instance of the app and close this one
'so the manifest is picked up
Shell(AppName, AppWinStyle.NormalFocus)
End
End If

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧