
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "headmain.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TFormMain *FormMain;
//---------------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::HeaderControl1SectionTrack(
THeaderControl *HeaderControl, THeaderSection *Section,
int Width, TSectionTrackState State)
{
Section->Width = Width;
Shape1->Width = HeaderControl->Sections->Items[0]->Width;
Shape2->Width = HeaderControl->Sections->Items[1]->Width;
Shape2->Left = HeaderControl->Sections->Items[1]->Left;
Shape3->Width = HeaderControl->Sections->Items[2]->Width;
Shape3->Left = HeaderControl->Sections->Items[2]->Left;
}
//---------------------------------------------------------------------
本文档展示了如何在VCL环境下实现一个响应式头控条,通过监听HeaderControl的SectionTrack事件,动态调整形状组件的宽度和位置,确保在不同宽屏下保持一致性。
918

被折叠的 条评论
为什么被折叠?



