Jump to content

Something about Dynamic create UnimLabel?


55143681

Recommended Posts

24 minutes ago, Sherzod said:

Hello,

What alignment are you using? Can you make a simple testcase to check?

    TUnimPanel *newPanel=new TUnimPanel(this);
    newPanel->Name="newPanel"+String(subId);
    newPanel->Parent=this;//指定其爹
    newPanel->Height=300;
    newPanel->Align=alTop;//顶部靠齐
    newPanel->AlignWithMargins=true;//按边距对齐

    TUnimLabel *newLabel=new TUnimLabel(this);
    newLabel->Name="newLabel"+String(subId);
    newLabel->Parent=newPanel;//指定其爹
    newLabel->Align=alTop;
    newLabel->Font->Size=15;//字体大小
    newLabel->Font->Color=clRed;//字体颜色
    newLabel->AutoSize=true;//自动调整大小
    newLabel->Caption="第"+String(subId)+"题("+subType+") "+subText;//题目文本

 

       TUnimMemo *newMemo=new TUnimMemo(this);
        newMemo->Name="newMemo"+String(subId);
        newMemo->Parent=newPanel;
        newMemo->Align=alTop;
        newMemo->Font->Size=15;
        newMemo->Font->Color=clBlack;

Link to comment
Share on other sites

3 minutes ago, 55143681 said:

    TUnimPanel *newPanel=new TUnimPanel(this);
    newPanel->Name="newPanel"+String(subId);
    newPanel->Parent=this;//指定其爹
    newPanel->Height=300;
    newPanel->Align=alTop;//顶部靠齐
    newPanel->AlignWithMargins=true;//按边距对齐

    TUnimLabel *newLabel=new TUnimLabel(this);
    newLabel->Name="newLabel"+String(subId);
    newLabel->Parent=newPanel;//指定其爹
    newLabel->Align=alTop;
    newLabel->Font->Size=15;//字体大小
    newLabel->Font->Color=clRed;//字体颜色
    newLabel->AutoSize=true;//自动调整大小
    newLabel->Caption="第"+String(subId)+"题("+subType+") "+subText;//题目文本

 

       TUnimMemo *newMemo=new TUnimMemo(this);
        newMemo->Name="newMemo"+String(subId);
        newMemo->Parent=newPanel;
        newMemo->Align=alTop;
        newMemo->Font->Size=15;
        newMemo->Font->Color=clBlack;

The alignmentControl is default,I think that will be uniAlignmentServer

Link to comment
Share on other sites

7 minutes ago, 55143681 said:

Here is delphi version,the problem is same.

Help me please.

testNewmLabel2.zip 7.58 MB · 0 downloads

If I set UnimPanel1's AlignmentControl=uniAlignmentClient,

then UnimLabel and UnimMemo will stay the positon they should be.

but ,

if I click UnimMemo and input text,

UnimMemo will cover UnimLabel,and UnimLabel will lost.

Link to comment
Share on other sites

On 4/2/2021 at 3:33 PM, 55143681 said:

If I set UnimPanel1's AlignmentControl=uniAlignmentClient,

then UnimLabel and UnimMemo will stay the positon they should be.

but ,

if I click UnimMemo and input text,

UnimMemo will cover UnimLabel,and UnimLabel will lost.

Sherzod:

Help me please:)

Link to comment
Share on other sites

×
×
  • Create New...