社区
C#
帖子详情
如何改变系统的颜色?
yaojiabinnet
2004-12-23 11:50:30
用C#实现 改变系统的颜色(如 从256色变为16位色、从32位色变成16位)
...全文
272
24
打赏
收藏
如何改变系统的颜色?
用C#实现 改变系统的颜色(如 从256色变为16位色、从32位色变成16位)
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
24 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yaohangnet
2005-01-11
打赏
举报
回复
[DllImport("gdi32.dll", EntryPoint="GetDeviceCaps")]
public static extern int GetDeviceCaps (
IntPtr hdc,
int nIndex
);
[DllImport("user32.dll", EntryPoint="GetDC")]
public static extern IntPtr GetDC (
IntPtr hwnd
);
private void btn_Click(object sender, System.EventArgs e) {
int i = GetDeviceCaps(GetDC(this.Handle), 12);
MessageBox.Show(i.ToString() + "位色");
}
参考。。。。。。。。。。。。。。。。。。。。。。。。。。。
yaojiabinnet
2005-01-10
打赏
举报
回复
大峡 都跑的哪里去了???????????????????????
5555555555555555555555555555555555555555555555555555555555555555
lucbesson
2005-01-07
打赏
举报
回复
GZ
yaojiabinnet
2005-01-07
打赏
举报
回复
UP
大户翁
2005-01-06
打赏
举报
回复
gz
yaojiabinnet
2005-01-05
打赏
举报
回复
自己 up 一下
yaojiabinnet
2005-01-05
打赏
举报
回复
晕倒
神啊 揪揪我吧!!!!!!
alexxzr
2005-01-04
打赏
举报
回复
UP
yaojiabinnet
2005-01-04
打赏
举报
回复
救命!!!!!!!!!!!!!!!!!!!!!!!!!!!
hanbinghai
2004-12-31
打赏
举报
回复
C#调用控制面板选项
在Windows操作系统中,控制面板的文件一般是以“.cpl”为后缀的,下表列出Windows控制面板常用的选项及其文件名:
-------------------------------------------------------------------------------------------------
选项 文件名
--------------------------------------------------------------------------------------------------
Internet选项: inetcpl.cpl
ODBC数据源管理: odbccp32.cpl
电话和调制解调器选项: telephon.cpl
电源选项: powercfg.cpl
辅助功能选项: access.cpl
区域和语言选项: intl.cpl
日期和时间: timedate.cpl
声音和音频设备: mmsys.cpl
鼠标: main.cpl
添加或删除程序: appwiz.cpl
添加硬件: hdwwiz.cpl
网络连接: ncpa.cpl
系统: sysdm.cpl
显示: desk.cpl
用户帐户: nusrmgr.cpl
游戏控制器: joy.cpl
语音: sapi.cpl
----------------------------------------------------------------------------------------------------
字体: Fonts
----------------------------------------------------------------------------------------------------
这些是常用的控制面板中的选项。
hanbinghai
2004-12-31
打赏
举报
回复
调用系统设置行不行
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;
namespace CsharpCallCPL
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(192, 72);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "调用";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(40, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(203, 24);
this.label1.TabIndex = 1;
this.label1.Text = "C#调用控制面板范例";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(296, 125);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label1,
this.button1});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
ProcessStartInfo Info=new ProcessStartInfo();
try
{
// Info.FileName="sysdm.cpl";
Info.FileName = "desk.cpl";
Process.Start(Info);
}
catch(Win32Exception win32ex)
{
MessageBox.Show("出错原因:"+win32ex.Message,"出错",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
}
}
yaohangnet
2004-12-31
打赏
举报
回复
关注!
yaojiabinnet
2004-12-31
打赏
举报
回复
to hanbinghai(海宁) 谢谢啦!!!
其实 我想要的是 不要弹出显示属性窗体 ,
直接改成要求的颜色
就想修改分辨率一样
如 http://community.csdn.net/Expert/topic/3463/3463624.xml?temp=.3610193
yaojiabinnet
2004-12-29
打赏
举报
回复
up
yaojiabinnet
2004-12-28
打赏
举报
回复
自己再顶!!!!!!!!!!!!!!!!!!!!!!!
yaojiabinnet
2004-12-24
打赏
举报
回复
up
nga96
2004-12-23
打赏
举报
回复
这个能行么?呵,不知道
kong19
2004-12-23
打赏
举报
回复
用API函数试试
SetSysColors
[DllImport("user32.dll", EntryPoint="SetSysColors")]
public static extern int SetSysColors (
int nChanges,
ref int lpSysColor,
ref int lpColorValues
);
nChanges ------- Long,欲改变的对象的数量
lpSysColor ----- Long,按引用传递。这是一个整数数组(总共包含nChanges个元素)的第一个元素。每个条目都包含了一个常数,指定一个windows显示对象。参考GetSysColor函数
lpColorValues -- Long,按引用传递。这是RGB值数组的第一个元素;该数组用于设置lpSysColor数组中的对象颜色
wangxt
2004-12-23
打赏
举报
回复
帮你顶
liulxmooo
2004-12-23
打赏
举报
回复
up
加载更多回复(4)
数字成像
系统
数字成像
系统
暨Image signal processor原理培训,涵盖成像
系统
基础5讲:1. 数字成像
系统
介绍2. CMOS image sensor基础3. 镜头光学基础4.
颜色
科学基础5. ISP 信号处理基础,以及ISP各模块:6.黑电平与线性化7.Green Imbalance8:9.坏点消除等21讲,3A技术以及图像质量评价与调校6讲
Qt 如何
改变
窗口(
系统
)标题栏的
颜色
?
Qt如何
改变
窗口(
系统
)标题栏的
颜色
?
C语言怎么
改变
窗口的字体
颜色
和背景
颜色
?
如果学C语言久了,难免会对弹出的黑窗口感到厌烦,那这时候如果能改一下黑窗口的背景
颜色
和字体
颜色
,也许会给自己一个好一点的心情。废话不多说,现在开始教你怎么简单地
改变
窗口的字体
颜色
和背景
颜色
。
如何设置文字
颜色
和背景
颜色
?
如何设置文字
颜色
和背景
颜色
?
虚拟机linux
改变
背景,ubuntu虚拟
系统
怎么设置终端背景和字体
颜色
?,
ubuntu虚拟
系统
怎么设置终端背景和字体
颜色
?,虽然成功安装了一个虚拟
系统
,但是却不喜欢它的背景
颜色
,和字体
颜色
,怎么办呢?下面教你怎么设置,什么
颜色
都行,想要透明的也ok。这里介绍的是ubantu虚拟
系统
的。1、打开你已经安装好的虚拟机。2、登陆进去。3、带虚拟机准备好后,右击,打开terminal(终端),将鼠标移到左上角你会看到terminal,file,edit等一菜单栏,4、点击edi...
C#
110,536
社区成员
642,576
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章