0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C++ Builder XE4 > TMonthCalendar > 1日から4日をBold表示 > Boldかどうか分かりにくい

Last updated at Posted at 2018-11-28
動作環境
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;
}
//---------------------------------------------------------------------------

実行例

11月
2018-11-28_16h22_22.png

12月
2018-11-28_16h22_34.png

  • Boldかどうか分かりにくい
  • 月を変えた時、その月で1日から4日がBold表示
  • 設定していない日もBoldになっているような
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?