![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
Xx哼哼xX
在编程中享受高手对决的快感!
展开
-
有关窗体创建代码(Form常做设置)
1.创建的窗体大小固定:Form-> BorderStyle ->bsSingle;或Form-> BorderStyle ->bsDialog; 2.设置窗体右上角按钮数量:Form -> BorderIcons-> biMinimize = true;Form -> BorderIcons-> biMaximize = true;Form -> BorderIco原创 2009-11-05 13:44:00 · 374 阅读 · 0 评论 -
序列化的过程
序列化是从固定存储介质中读和写一个对象的过程,例如磁盘文件。序列化一个对象需要三个要素:Ø 一个描述数据文件的CFile对象Ø 一个提供序列化上下文的Carchive对象Ø 一个可以被序列化的对象第一步:打开数据文件用适当的存取方式打开用于保存序列化信息的foo.dat文件。在本例中,文件将以独占的可读写方式打开。// Open file "foo.dat" CFile* pFile = new CFile(); ASSERT (pFil原创 2010-12-23 14:33:00 · 539 阅读 · 0 评论 -
C++中const的用法汇总
1、什么是const? 常类型是指使用类型修饰符const说明的类型,常类型的变量或对象的值是不能被更新的。(当然,我们可以偷梁换柱进行更新:) 2、为什么引入const? const 推出的初始目的,正是为了取代预编译指令,消除它的缺点,同时继承它的优点。 3、cons有什么主要的作用? (1)可以定义const常量,具有不可变性。 例如: const int Max=100; int原创 2010-05-28 11:23:00 · 292 阅读 · 0 评论 -
有关BCB使用GDI+
GDI+是微软公司推出的新一代图形设备接口,功能强大。不再像传统的GDI那样让人的心志严重地受挫,GDI+具有很多新特性(如支持Alpha、渐变色填充、反锯齿等),并具有面向对象特性,这使得开发人员可以更方便、更形象地进行GDI+开发。目前在BCB环境中使用GDI+进行开发则还需要进行一定的设置和步骤才能成功编译和链接。以下我就以BCB6为例进行简单的说明:1、建立编译链接环境: GDI转载 2009-12-29 14:16:00 · 686 阅读 · 0 评论 -
从一个日历程序中寻找bcb时间函数及ComboBox的一个方法
int y = YearOf(Date());int m = MonthOf(Date()); TDateTime dtFirst = EncodeDate(year, month, 1);int week = DayOfWeek(dtFirst); week -= 1; int daySum = DayOfTheMonth(EndOfTheMonth(dtFirst));原创 2010-01-14 09:21:00 · 1539 阅读 · 0 评论 -
有关.ini文件的读写
#include "IniFiles.hpp" TIniFile *ini = new TIniFile (ChangeFileExt (Application->ExeName, ".ini"));ini->WriteString ("Login", "User", edtUser->Text); ini->ReadString ("Login", "User", edtUser->原创 2009-11-16 14:15:00 · 363 阅读 · 0 评论 -
有关StringGrid控件的代码和一些注意
1.StringGrid->FixedRows必须小于StringGrid->RowCount StringGrid->FixedCols必须小于StringGrid->ColCount 2. 如果想去掉StringGrid显示时选中的区域,就要将defaultdraw设为false,然后在自画StringGrid。 3.设置单独某行的宽度StringGrid->原创 2009-11-16 09:26:00 · 845 阅读 · 0 评论 -
TProgressBar应用
首先New一个Form1,然后在Form1上放置一个TProgressBar控件。点击MainForm的btn1按钮,实现进度条更新! TMainForm *MainForm;//---------------------------------------------------------------------------__fastcall TMainForm::TMainForm原创 2009-11-06 17:12:00 · 412 阅读 · 0 评论 -
Edit随输入自动增长
const int DEFAULT = 10; //---------------------------------------------------------------------------void __fastcall TChartForm::edtTextChange(TObject *Sender){ int Length = Image1->Canvas->T原创 2009-11-06 13:43:00 · 267 阅读 · 0 评论 -
保持各组件相对窗体的位置
在BCB中,一旦组件放下,其位置也就固定了,所以当鼠标拉动窗口后,组件会保持不变,下面代码实现各组件相对窗体位置不变功能 TForm1 *Form1;//---------------------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner)原创 2009-11-06 11:57:00 · 503 阅读 · 0 评论 -
设置程序在任务管理器隐藏,在进程可见
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ try { Application->Initialize(); Application->CreateForm(__classid(TForm1), &Form1); Application->ShowMainForm = Fals原创 2009-11-06 11:42:00 · 1690 阅读 · 0 评论 -
设置背景图片
TForm1 *Form1;//---------------------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){}//-------------------------------------------原创 2009-11-06 11:19:00 · 405 阅读 · 0 评论 -
实现背景渐变功能
TForm1 *Form1;//---------------------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){}//-------------------------------------------原创 2009-11-06 10:57:00 · 388 阅读 · 0 评论 -
更改当前鼠标的形状
Screen->Cursor = crDefault;Screen->Cursor = crCross;Screen->Cursor = crArrow;Screen->Cursor = crHelp;Screen->Cursor = crHourGlass;Screen->Cursor = crSQLWait;原创 2009-11-06 09:47:00 · 407 阅读 · 0 评论