-
百度智能手环 源代码
百度智能手环 源代码 计步 睡眠 算法
- 2022-08-10 05:51:03下载
- 积分:1
-
改善C#的157个建议编写高质量代码_源代码合集
改善C#的157个建议编写高质量代码_源代码合集,这些实例均采用4.0框架,请运行使用Release模式;部分TIP由于简单未给出源码;这157个建议的源码涉及到语言篇、集合和LINQ、泛型、委托和事件、资源管理和序列化、异常与自定义异常、异步、多线程、任务和并行、架构篇成员设计、类型设计、安全性设计、编码规范及习惯、代码整洁、规范开发行为等,每类细分一共形成了157条建议,相信这些建议对于向高深进阶的C#开发者来说,是难得的建议。
- 2022-07-10 03:10:19下载
- 积分:1
-
几个C# 窗口标题栏 按钮 任务栏自定义实例
本源码主要是收集的几个C# 窗口标题栏 按钮 任务栏自定义实例,比如隐藏和显示标题栏、允许和禁止在窗口任务栏显示程序图标等,帮助C#初学者了解一些基础的C#窗口操作知识,有很好的学习参考价值。
private void button1_Click(object sender, RoutedEventArgs e)
{//隐藏标题栏
this.WindowStyle = System.Windows.WindowStyle.None;
}
private void button2_Click(object sender, RoutedEventArgs e)
{//显示标题栏
this.WindowStyle = System.Windows.WindowStyle.SingleBorderWindow;
}
private void button3_Click(object sender, RoutedEventArgs e)
{//禁止在任务栏上显示程序按钮
this.ShowInTaskbar = false;
}
private void button4_Click(object sender, RoutedEventArgs e)
{//允许在任务栏上显示程序按钮
this.ShowInTaskbar = true;
}
如下图所示,点击对应的按钮,可演示对应的功能。
- 2023-03-24 21:30:03下载
- 积分:1
-
C# 使用 tabControl创建窗体TAB效果
C# 使用 tabControl创建窗体TAB选项卡效果,大家都熟悉的功能,这个例子比较基础,面向C#的初学者,下面是实现本功能的核心代码:
private void Form1_Load(object sender, EventArgs e)
{
tabControl1.ImageList = imageList1;
tabPage1.ImageIndex = 0;
tabPage1.Text = "选项卡1";
tabPage2.ImageIndex = 0;
tabPage2.Text = "选项卡2";
}
本TAB运行效果请参见截图,完整源码请下载。
- 2022-08-22 06:09:52下载
- 积分:1
-
C# 为文字创建渐变色的下划线
C# 为文字创建渐变色的下划线,放大后还是很漂亮的,下划线变成了点状的,而且是颜色是渐变的,下面介绍实现这一功能的代码,给字符串创建渐变色下划线,核心代码如下:
TextDecoration MyUnderline = new TextDecoration();
Pen MyPen = new Pen();
MyPen.Brush = new LinearGradientBrush(Colors.Green,
Colors.Blue, new Point(0, 0.5), new Point(1, 0.5));
MyPen.Brush.Opacity = 0.5;
MyPen.Thickness = 1.5;
MyPen.DashStyle = DashStyles.Dash;
MyUnderline.Pen = MyPen;
MyUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;
TextDecorationCollection MyCollection = new TextDecorationCollection();
MyCollection.Add(MyUnderline);
this.textBlock1.Text = "中华人民共和国";//自定义要显示下划线的文字
this.textBlock1.FontSize = 48;
this.textBlock1.TextDecorations = MyCollection;
需要请下载完整源码。运行效果图如下。
- 2022-01-22 05:14:06下载
- 积分:1
-
Visual C#对 XML操作的演示示例集
这是一个C#操作XML文件的示例集,可完成 如下功能演示:
枚举XML集合中的元素名称
枚举XML集合中的元素文本
判断XML元素在集合中是否存在
筛选XML中的子代元素集合
使用链接轴方法枚举XML元素
根据元素属性查找XML元素
根据元素名称查找XML元素
根据元素属性和名称查找XML元素
根据中间计算值查找XML元素
比如枚举XML集合中的元素文本:private void button2_Click(object sender, EventArgs e)
{//枚举XML集合中的元素文本
XElement MyXElements = new XElement("Root",
new XElement("贵州省", "贵阳市"),
new XElement("四川省", "成都市"));
IEnumerable MyXElement =
from MySelect in MyXElements.Elements()
select MySelect;
string MyInfo = "元素文本包括:";
foreach (XElement MyValue in MyXElement)
MyInfo += MyValue.Value + "、";
//显示:贵阳市、成都市
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK);
}
- 2022-03-14 22:11:51下载
- 积分:1
-
C# 从RichTextBox 控件中提取文本内容
C# 从RichTextBox 控件中提取文本内容,并设置RichTextBox 控件中的字体大小-附完整源代码,
private void button1_Click(object sender, RoutedEventArgs e)
{//从RichTextBox 控件中提取文本内容
TextRange MyText = new TextRange(this.richTextBox1.Document.ContentStart, this.richTextBox1.Document.ContentEnd);
MessageBox.Show(MyText.Text, "RichTextBox控件中的文本内容",MessageBoxButton.OK);
}
private void button2_Click(object sender, RoutedEventArgs e)
{//设置RichTextBox 控件中的字体大小
TextRange MyText = new TextRange(this.richTextBox1.Document.ContentStart, this.richTextBox1.Document.ContentEnd);
MyText.ApplyPropertyValue(TextElement.FontSizeProperty, 36.00);
MyText.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
- 2022-09-21 17:55:02下载
- 积分:1
-
STM32F1的SPWM逆变器源码
#include "SPWM.h"
#include "led.h"
#include "usart.h"
u16 TimerPeriod = 7200;
u16 DutyFactor = 50;
void TIM_Int_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM3,ENABLE); //时钟使能
/* GPIOA配置:通道PA.6和PA.7作为输出引脚*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
&nbs
- 2022-07-26 17:50:34下载
- 积分:1
-
C# 最简单的文件复制实例
C# 最简单的文件复制实例,文件拷贝的示例,比较简单,若要启用启用xp_cmdshell, 请查看启用xp_cmdshell使用说明。
- 2022-03-01 11:06:17下载
- 积分:1
-
C# WPF 功能打印的示例
C# WPF 功能打印的示例,加载内容后,可在本程序中直接打印出XAML文档。
private void button2_Click(object sender, RoutedEventArgs e)
{//打印文件
PrintDialog MyDialog = new PrintDialog();
if ((MyDialog.ShowDialog() == true))
{
MyDialog.PrintVisual(this.richTextBox1 as Visual, "我的XAML打印文档");
}
}
private void button3_Click(object sender, RoutedEventArgs e)
{//保存文件
string MyFileName = "MyFile.XAML";
TextRange MyTextRange;
System.IO.FileStream MyStream;
MyTextRange = new TextRange(this.richTextBox1.Document.ContentStart, this.richTextBox1.Document.ContentEnd);
MyStream = new System.IO.FileStream(MyFileName, System.IO.FileMode.Create);
MyTextRange.Save(MyStream, DataFormats.XamlPackage);
MyStream.Close();
}
- 2022-01-23 10:57:00下载
- 积分:1