winform壁紙工具為圖片添加當(dāng)前月的日歷信息
更新時(shí)間:2013年03月01日 10:13:17 作者:
使用用winform做了一個(gè)設(shè)置壁紙小工具,為圖片添加當(dāng)月的日歷并設(shè)為壁紙,可以手動(dòng)/定時(shí)設(shè)置壁紙,最主要的特點(diǎn)是在圖片上生成當(dāng)前月的日歷信息,感興趣的你可以參考下
這幾天用winform做了一個(gè)設(shè)置壁紙的小工具, 為圖片添加當(dāng)月的日歷并設(shè)為壁紙,可以手動(dòng)設(shè)置壁紙,也可以定時(shí)設(shè)置壁紙,最主要的特點(diǎn)是在圖片上生成當(dāng)前月的日歷信息。
工具和桌面設(shè)置壁紙后的效果如下:
在圖片上畫日歷的類代碼Calendar.cs如下:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
namespace SetWallpaper
{
public class Calendar
{
/// <summary>
/// 計(jì)算星期幾: 星期日至星期六的值為0-6
/// </summary>
public static int GetWeeksOfDate(int year, int month, int day)
{
DateTime dt = new DateTime(year, month, day);
DayOfWeek d = dt.DayOfWeek;
return Convert.ToInt32(d);
}
/// <summary>
/// 獲取指定年月的天數(shù)
/// </summary>
public static int GetDaysOfMonth(int year, int month)
{
DateTime dtCur = new DateTime(year, month, 1);
int days = dtCur.AddMonths(1).AddDays(-1).Day;
return days;
}
/// <summary>
/// 獲取在圖片上生成日歷的圖片
/// </summary>
public static Bitmap GetCalendarPic(Image img)
{
Bitmap bmp = new Bitmap(img.Width, img.Height, PixelFormat.Format24bppRgb);
bmp.SetResolution(72, 72);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawImage(img, 0, 0, img.Width, img.Height);
DateTime dtNow = DateTime.Now;
int year = dtNow.Year;
int month = dtNow.Month;
int day = dtNow.Day;
int day1st = Calendar.GetWeeksOfDate(year, month, 1); //第一天星期幾
int days = Calendar.GetDaysOfMonth(year, month); //獲取想要輸出月份的天數(shù)
int startX = img.Width / 2; //開始的X軸位置
int startY = img.Height / 4; //開始的Y軸位置
int posLen = 50; //每次移動(dòng)的位置長(zhǎng)度
int x = startX + day1st * posLen; //1號(hào)的開始X軸位置
int y = startY + posLen * 2;//1號(hào)的開始Y軸位置
Calendar.DrawStr(g, dtNow.ToString("yyyy年MM月dd日"), startX, startY);
string[] weeks = { "日", "一", "二", "三", "四", "五", "六" };
for (int i = 0; i < weeks.Length; i++)
Calendar.DrawStr(g, weeks[i], startX + posLen * i, startY + posLen);
for (int j = 1; j <= days; j++)
{
if (j == day)//如果是今天,設(shè)置背景色
Calendar.DrawStrToday(g, j.ToString().PadLeft(2, ' '), x, y);
else
Calendar.DrawStr(g, j.ToString().PadLeft(2, ' '), x, y);
//星期六結(jié)束到星期日時(shí)換行,X軸回到初始位置,Y軸增加
if ((day1st + j) % 7 == 0)
{
x = startX;
y = y + posLen;
}
else
x = x + posLen;
}
return bmp;
}
}
/// <summary>
/// 繪制字符串
/// </summary>
public static void DrawStr(Graphics g, string s, float x, float y)
{
Font font = new Font("宋體", 25, FontStyle.Bold);
PointF pointF = new PointF(x, y);
g.DrawString(s, font, new SolidBrush(Color.Yellow), pointF);
}
/// <summary>
/// 繪制有背景顏色的字符串
/// </summary>
public static void DrawStrToday(Graphics g, string s, float x, float y)
{
Font font = new Font("宋體", 25, FontStyle.Bold);
PointF pointF = new PointF(x, y);
SizeF sizeF = g.MeasureString(s, font);
g.FillRectangle(Brushes.White, new RectangleF(pointF, sizeF));
g.DrawString(s, font, Brushes.Black, pointF);
}
}
}
主窗體設(shè)置壁紙等的代碼FrmMain.cs如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Drawing2D;
using Microsoft.Win32;
using System.Collections;
using System.Runtime.InteropServices;
using System.Xml;
using System.Drawing.Imaging;
namespace SetWallpaper
{
public partial class FrmMain : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
int screenWidth = Screen.PrimaryScreen.Bounds.Width;
int screenHeight = Screen.PrimaryScreen.Bounds.Height;
FileInfo[] picFiles;
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
List<DictionaryEntry> list = new List<DictionaryEntry>(){
new DictionaryEntry(1, "居中顯示"),
new DictionaryEntry(2, "平鋪顯示"),
new DictionaryEntry(3, "拉伸顯示")
};
cbWallpaperStyle.DisplayMember = "Value";
cbWallpaperStyle.ValueMember = "Key";
cbWallpaperStyle.DataSource = list;
txtPicDir.Text = XmlNodeInnerText("");
timer1.Tick += new EventHandler(timer_Tick);
Text = string.Format("設(shè)置桌面壁紙(當(dāng)前電腦分辨率{0}×{1})", screenWidth, screenHeight);
}
/// <summary>
/// 瀏覽單個(gè)圖片
/// </summary>
private void btnBrowse_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Images (*.BMP;*.JPG)|*.BMP;*.JPG;";
openFileDialog.AddExtension = true;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
Bitmap img = (Bitmap)Bitmap.FromFile(openFileDialog.FileName);
pictureBox1.Image = img;
string msg = (img.Width != screenWidth || img.Height != screenHeight) ? ",建議選擇和桌面分辨率一致圖片" : "";
lblStatus.Text = string.Format("當(dāng)前圖片分辨率{0}×{1}{2}", img.Width, img.Height, msg);
}
}
}
/// <summary>
/// 手動(dòng)設(shè)置壁紙
/// </summary>
private void btnSet_Click(object sender, EventArgs e)
{
if (pictureBox1.Image == null)
{
MessageBox.Show("請(qǐng)先選擇一張圖片。");
return;
}
Image img = pictureBox1.Image;
SetWallpaper(img);
}
private void SetWallpaper(Image img)
{
Bitmap bmp = Calendar.GetCalendarPic(img);
string filename = Application.StartupPath + "/wallpaper.bmp";
bmp.Save(filename, ImageFormat.Bmp);
string tileWallpaper = "0";
string wallpaperStyle = "0";
string selVal = cbWallpaperStyle.SelectedValue.ToString();
if (selVal == "1")
tileWallpaper = "1";
else if (selVal == "2")
wallpaperStyle = "2";
//寫到注冊(cè)表,避免系統(tǒng)重啟后失效
RegistryKey regKey = Registry.CurrentUser;
regKey = regKey.CreateSubKey("Control Panel\\Desktop");
//顯示方式,居中:0 0, 平鋪: 1 0, 拉伸: 0 2
regKey.SetValue("TileWallpaper", tileWallpaper);
regKey.SetValue("WallpaperStyle", wallpaperStyle);
regKey.SetValue("Wallpaper", filename);
regKey.Close();
SystemParametersInfo(20, 1, filename, 1);
}
/// <summary>
/// 瀏覽文件夾
/// </summary>
private void btnBrowseDir_Click(object sender, EventArgs e)
{
string defaultfilePath = XmlNodeInnerText("");
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
if (defaultfilePath != "")
dialog.SelectedPath = defaultfilePath;
if (dialog.ShowDialog() == DialogResult.OK)
XmlNodeInnerText(dialog.SelectedPath);
txtPicDir.Text = dialog.SelectedPath;
}
}
/// <summary>
/// 獲取或設(shè)置配置文件中的選擇目錄
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public string XmlNodeInnerText(string text)
{
string filename = Application.StartupPath + "/config.xml";
XmlDocument doc = new XmlDocument();
if (!File.Exists(filename))
{
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
doc.AppendChild(dec);
XmlElement elem = doc.CreateElement("WallpaperPath");
elem.InnerText = text;
doc.AppendChild(elem);
doc.Save(filename);
}
else
{
doc.Load(filename);
XmlNode node = doc.SelectSingleNode("http://WallpaperPath");
if (node != null)
{
if (string.IsNullOrEmpty(text))
return node.InnerText;
else
{
node.InnerText = text;
doc.Save(filename);
}
}
}
return text;
}
/// <summary>
/// 定時(shí)自動(dòng)設(shè)置壁紙
/// </summary>
private void btnAutoSet_Click(object sender, EventArgs e)
{
string path = txtPicDir.Text;
if (!Directory.Exists(path))
{
MessageBox.Show("選擇的文件夾不存在");
return;
}
DirectoryInfo dirInfo = new DirectoryInfo(path);
picFiles = dirInfo.GetFiles("*.jpg");
if (picFiles.Length == 0)
{
MessageBox.Show("選擇的文件夾里面沒有圖片");
return;
}
if (btnAutoSet.Text == "開始")
{
timer1.Start();
btnAutoSet.Text = "停止";
lblStatus.Text = string.Format("定時(shí)自動(dòng)換壁紙中...");
}
else
{
timer1.Stop();
btnAutoSet.Text = "開始";
lblStatus.Text = "";
}
}
/// <summary>
/// 定時(shí)隨機(jī)設(shè)置壁紙
/// </summary>
private void timer_Tick(object sender, EventArgs e)
{
timer1.Interval = 1000 * 60 * (int)numericUpDown1.Value;
FileInfo[] files = picFiles;
if (files.Length > 0)
{
Random random = new Random();
int r = random.Next(1, files.Length);
Bitmap img = (Bitmap)Bitmap.FromFile(files[r].FullName);
pictureBox1.Image = img;
SetWallpaper(img);
}
}
/// <summary>
/// 雙擊托盤圖標(biāo)顯示窗體
/// </summary>
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
ShowForm();
}
/// <summary>
/// 隱藏窗體,并顯示托盤圖標(biāo)
/// </summary>
private void HideForm()
{
this.Visible = false;
this.WindowState = FormWindowState.Minimized;
notifyIcon1.Visible = true;
}
/// <summary>
/// 顯示窗體
/// </summary>
private void ShowForm()
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
notifyIcon1.Visible = false;
}
private void ToolStripMenuItemShow_Click(object sender, EventArgs e)
{
ShowForm();
}
/// <summary>
/// 退出
/// </summary>
private void toolStripMenuItemExit_MouseDown(object sender, MouseEventArgs e)
{
Application.Exit();
}
/// <summary>
/// 最小化時(shí)隱藏窗體,并顯示托盤圖標(biāo)
/// </summary>
private void FrmMain_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
HideForm();
}
}
}
}
工具和桌面設(shè)置壁紙后的效果如下:

在圖片上畫日歷的類代碼Calendar.cs如下:
復(fù)制代碼 代碼如下:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
namespace SetWallpaper
{
public class Calendar
{
/// <summary>
/// 計(jì)算星期幾: 星期日至星期六的值為0-6
/// </summary>
public static int GetWeeksOfDate(int year, int month, int day)
{
DateTime dt = new DateTime(year, month, day);
DayOfWeek d = dt.DayOfWeek;
return Convert.ToInt32(d);
}
/// <summary>
/// 獲取指定年月的天數(shù)
/// </summary>
public static int GetDaysOfMonth(int year, int month)
{
DateTime dtCur = new DateTime(year, month, 1);
int days = dtCur.AddMonths(1).AddDays(-1).Day;
return days;
}
/// <summary>
/// 獲取在圖片上生成日歷的圖片
/// </summary>
public static Bitmap GetCalendarPic(Image img)
{
Bitmap bmp = new Bitmap(img.Width, img.Height, PixelFormat.Format24bppRgb);
bmp.SetResolution(72, 72);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawImage(img, 0, 0, img.Width, img.Height);
DateTime dtNow = DateTime.Now;
int year = dtNow.Year;
int month = dtNow.Month;
int day = dtNow.Day;
int day1st = Calendar.GetWeeksOfDate(year, month, 1); //第一天星期幾
int days = Calendar.GetDaysOfMonth(year, month); //獲取想要輸出月份的天數(shù)
int startX = img.Width / 2; //開始的X軸位置
int startY = img.Height / 4; //開始的Y軸位置
int posLen = 50; //每次移動(dòng)的位置長(zhǎng)度
int x = startX + day1st * posLen; //1號(hào)的開始X軸位置
int y = startY + posLen * 2;//1號(hào)的開始Y軸位置
Calendar.DrawStr(g, dtNow.ToString("yyyy年MM月dd日"), startX, startY);
string[] weeks = { "日", "一", "二", "三", "四", "五", "六" };
for (int i = 0; i < weeks.Length; i++)
Calendar.DrawStr(g, weeks[i], startX + posLen * i, startY + posLen);
for (int j = 1; j <= days; j++)
{
if (j == day)//如果是今天,設(shè)置背景色
Calendar.DrawStrToday(g, j.ToString().PadLeft(2, ' '), x, y);
else
Calendar.DrawStr(g, j.ToString().PadLeft(2, ' '), x, y);
//星期六結(jié)束到星期日時(shí)換行,X軸回到初始位置,Y軸增加
if ((day1st + j) % 7 == 0)
{
x = startX;
y = y + posLen;
}
else
x = x + posLen;
}
return bmp;
}
}
/// <summary>
/// 繪制字符串
/// </summary>
public static void DrawStr(Graphics g, string s, float x, float y)
{
Font font = new Font("宋體", 25, FontStyle.Bold);
PointF pointF = new PointF(x, y);
g.DrawString(s, font, new SolidBrush(Color.Yellow), pointF);
}
/// <summary>
/// 繪制有背景顏色的字符串
/// </summary>
public static void DrawStrToday(Graphics g, string s, float x, float y)
{
Font font = new Font("宋體", 25, FontStyle.Bold);
PointF pointF = new PointF(x, y);
SizeF sizeF = g.MeasureString(s, font);
g.FillRectangle(Brushes.White, new RectangleF(pointF, sizeF));
g.DrawString(s, font, Brushes.Black, pointF);
}
}
}
主窗體設(shè)置壁紙等的代碼FrmMain.cs如下:
復(fù)制代碼 代碼如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Drawing2D;
using Microsoft.Win32;
using System.Collections;
using System.Runtime.InteropServices;
using System.Xml;
using System.Drawing.Imaging;
namespace SetWallpaper
{
public partial class FrmMain : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
int screenWidth = Screen.PrimaryScreen.Bounds.Width;
int screenHeight = Screen.PrimaryScreen.Bounds.Height;
FileInfo[] picFiles;
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
List<DictionaryEntry> list = new List<DictionaryEntry>(){
new DictionaryEntry(1, "居中顯示"),
new DictionaryEntry(2, "平鋪顯示"),
new DictionaryEntry(3, "拉伸顯示")
};
cbWallpaperStyle.DisplayMember = "Value";
cbWallpaperStyle.ValueMember = "Key";
cbWallpaperStyle.DataSource = list;
txtPicDir.Text = XmlNodeInnerText("");
timer1.Tick += new EventHandler(timer_Tick);
Text = string.Format("設(shè)置桌面壁紙(當(dāng)前電腦分辨率{0}×{1})", screenWidth, screenHeight);
}
/// <summary>
/// 瀏覽單個(gè)圖片
/// </summary>
private void btnBrowse_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Images (*.BMP;*.JPG)|*.BMP;*.JPG;";
openFileDialog.AddExtension = true;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
Bitmap img = (Bitmap)Bitmap.FromFile(openFileDialog.FileName);
pictureBox1.Image = img;
string msg = (img.Width != screenWidth || img.Height != screenHeight) ? ",建議選擇和桌面分辨率一致圖片" : "";
lblStatus.Text = string.Format("當(dāng)前圖片分辨率{0}×{1}{2}", img.Width, img.Height, msg);
}
}
}
/// <summary>
/// 手動(dòng)設(shè)置壁紙
/// </summary>
private void btnSet_Click(object sender, EventArgs e)
{
if (pictureBox1.Image == null)
{
MessageBox.Show("請(qǐng)先選擇一張圖片。");
return;
}
Image img = pictureBox1.Image;
SetWallpaper(img);
}
private void SetWallpaper(Image img)
{
Bitmap bmp = Calendar.GetCalendarPic(img);
string filename = Application.StartupPath + "/wallpaper.bmp";
bmp.Save(filename, ImageFormat.Bmp);
string tileWallpaper = "0";
string wallpaperStyle = "0";
string selVal = cbWallpaperStyle.SelectedValue.ToString();
if (selVal == "1")
tileWallpaper = "1";
else if (selVal == "2")
wallpaperStyle = "2";
//寫到注冊(cè)表,避免系統(tǒng)重啟后失效
RegistryKey regKey = Registry.CurrentUser;
regKey = regKey.CreateSubKey("Control Panel\\Desktop");
//顯示方式,居中:0 0, 平鋪: 1 0, 拉伸: 0 2
regKey.SetValue("TileWallpaper", tileWallpaper);
regKey.SetValue("WallpaperStyle", wallpaperStyle);
regKey.SetValue("Wallpaper", filename);
regKey.Close();
SystemParametersInfo(20, 1, filename, 1);
}
/// <summary>
/// 瀏覽文件夾
/// </summary>
private void btnBrowseDir_Click(object sender, EventArgs e)
{
string defaultfilePath = XmlNodeInnerText("");
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
if (defaultfilePath != "")
dialog.SelectedPath = defaultfilePath;
if (dialog.ShowDialog() == DialogResult.OK)
XmlNodeInnerText(dialog.SelectedPath);
txtPicDir.Text = dialog.SelectedPath;
}
}
/// <summary>
/// 獲取或設(shè)置配置文件中的選擇目錄
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public string XmlNodeInnerText(string text)
{
string filename = Application.StartupPath + "/config.xml";
XmlDocument doc = new XmlDocument();
if (!File.Exists(filename))
{
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
doc.AppendChild(dec);
XmlElement elem = doc.CreateElement("WallpaperPath");
elem.InnerText = text;
doc.AppendChild(elem);
doc.Save(filename);
}
else
{
doc.Load(filename);
XmlNode node = doc.SelectSingleNode("http://WallpaperPath");
if (node != null)
{
if (string.IsNullOrEmpty(text))
return node.InnerText;
else
{
node.InnerText = text;
doc.Save(filename);
}
}
}
return text;
}
/// <summary>
/// 定時(shí)自動(dòng)設(shè)置壁紙
/// </summary>
private void btnAutoSet_Click(object sender, EventArgs e)
{
string path = txtPicDir.Text;
if (!Directory.Exists(path))
{
MessageBox.Show("選擇的文件夾不存在");
return;
}
DirectoryInfo dirInfo = new DirectoryInfo(path);
picFiles = dirInfo.GetFiles("*.jpg");
if (picFiles.Length == 0)
{
MessageBox.Show("選擇的文件夾里面沒有圖片");
return;
}
if (btnAutoSet.Text == "開始")
{
timer1.Start();
btnAutoSet.Text = "停止";
lblStatus.Text = string.Format("定時(shí)自動(dòng)換壁紙中...");
}
else
{
timer1.Stop();
btnAutoSet.Text = "開始";
lblStatus.Text = "";
}
}
/// <summary>
/// 定時(shí)隨機(jī)設(shè)置壁紙
/// </summary>
private void timer_Tick(object sender, EventArgs e)
{
timer1.Interval = 1000 * 60 * (int)numericUpDown1.Value;
FileInfo[] files = picFiles;
if (files.Length > 0)
{
Random random = new Random();
int r = random.Next(1, files.Length);
Bitmap img = (Bitmap)Bitmap.FromFile(files[r].FullName);
pictureBox1.Image = img;
SetWallpaper(img);
}
}
/// <summary>
/// 雙擊托盤圖標(biāo)顯示窗體
/// </summary>
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
ShowForm();
}
/// <summary>
/// 隱藏窗體,并顯示托盤圖標(biāo)
/// </summary>
private void HideForm()
{
this.Visible = false;
this.WindowState = FormWindowState.Minimized;
notifyIcon1.Visible = true;
}
/// <summary>
/// 顯示窗體
/// </summary>
private void ShowForm()
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
notifyIcon1.Visible = false;
}
private void ToolStripMenuItemShow_Click(object sender, EventArgs e)
{
ShowForm();
}
/// <summary>
/// 退出
/// </summary>
private void toolStripMenuItemExit_MouseDown(object sender, MouseEventArgs e)
{
Application.Exit();
}
/// <summary>
/// 最小化時(shí)隱藏窗體,并顯示托盤圖標(biāo)
/// </summary>
private void FrmMain_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
HideForm();
}
}
}
}
您可能感興趣的文章:
- WinForm中實(shí)現(xiàn)picturebox自適應(yīng)圖片大小的方法
- C# WinForm控件對(duì)透明圖片重疊時(shí)出現(xiàn)圖片不透明的簡(jiǎn)單解決方法
- WinForm生成驗(yàn)證碼圖片的方法
- C#實(shí)現(xiàn)winform中RichTextBox在指定光標(biāo)位置插入圖片的方法
- Winform讓DataGridView左側(cè)顯示圖片
- Winform在DataGridView中顯示圖片
- winform 中顯示異步下載的圖片
- Winform實(shí)現(xiàn)將網(wǎng)頁(yè)生成圖片的方法
- Winform下實(shí)現(xiàn)圖片切換特效的方法
- 基于C# winform實(shí)現(xiàn)圖片上傳功能的方法
- Winform 顯示Gif圖片的實(shí)例代碼
- WinForm實(shí)現(xiàn)的圖片拖拽與縮放功能示例
相關(guān)文章
C#中事件的動(dòng)態(tài)調(diào)用實(shí)現(xiàn)方法
這篇文章主要介紹了C#中事件的動(dòng)態(tài)調(diào)用實(shí)現(xiàn)方法,對(duì)比傳統(tǒng)思路優(yōu)劣給出了一個(gè)新的解決方案,需要的朋友可以參考下2014-09-09C#中Convert.ToDecimal()報(bào)錯(cuò)問題的解決
這篇文章主要給大家介紹了關(guān)于C#中Convert.ToDecimal()報(bào)錯(cuò)問題的解決方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧。2017-08-08利用C#編寫一個(gè)Windows服務(wù)程序的方法詳解
這篇文章主要為大家詳細(xì)介紹了如何利用C#編寫一個(gè)Windows服務(wù)程序,文中的實(shí)現(xiàn)方法講解詳細(xì),具有一定的參考價(jià)值,感興趣的可以了解一下2023-03-03C#實(shí)現(xiàn)主窗體最小化后出現(xiàn)懸浮框及雙擊懸浮框恢復(fù)原窗體的方法
這篇文章主要介紹了C#實(shí)現(xiàn)主窗體最小化后出現(xiàn)懸浮框及雙擊懸浮框恢復(fù)原窗體的方法,涉及C#窗體及鼠標(biāo)事件響應(yīng)的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08C#使用struct直接轉(zhuǎn)換下位機(jī)數(shù)據(jù)的示例代碼
這篇文章主要介紹了C#使用struct直接轉(zhuǎn)換下位機(jī)數(shù)據(jù)的示例代碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-01-01C#實(shí)現(xiàn)會(huì)移動(dòng)的文字效果
這篇文章主要為大家詳細(xì)介紹了C#實(shí)現(xiàn)會(huì)移動(dòng)的文字效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-04-04