C++ Builder XE4 > TMonthCalendar > 1日から4日をBold表示 > Boldかどうか分かりにくい
6623 ワード
動作環境
C++ Builder XE4
Windows 7 Pro (32bit)
処理概要
- TMonthCalendarに関して、1日から4日をBold表示する
RadStudioのヘルプを見たが、意味が分からなかった。
参考
実装
Unit1.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Grids.hpp>
#include <Vcl.Samples.Calendar.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE で管理されるコンポーネント
TMonthCalendar *MonthCalendar1;
void __fastcall MonthCalendar1GetMonthBoldInfo(TObject *Sender, DWORD Month, DWORD Year,
DWORD &MonthBoldInfo);
private: // ユーザー宣言
public: // ユーザー宣言
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Unit1.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MonthCalendar1GetMonthBoldInfo(TObject *Sender, DWORD Month,
DWORD Year, DWORD &MonthBoldInfo)
{
unsigned int bolddays[] = {1, 2, 3, 4};
unsigned int days;
MonthCalendar1->BoldDays(bolddays, 4, days);
MonthBoldInfo = days;
}
//---------------------------------------------------------------------------
実行例
- Boldかどうか分かりにくい
- 月を変えた時、その月で1日から4日がBold表示
- 設定していない日もBoldになっているような
Author And Source
この問題について(C++ Builder XE4 > TMonthCalendar > 1日から4日をBold表示 > Boldかどうか分かりにくい), 我々は、より多くの情報をここで見つけました https://qiita.com/7of9/items/73e1debf8e8f91f409b8著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .