55143681 Posted April 1, 2021 Share Posted April 1, 2021 I create a UnimLabel within a UnimPanel and set it's align=alTop; then I create a UnimMemo within the same UnimPanel and set it's align=alTop, The matter is : UnimPanel will occupy UnimLabel's position,why? Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2021 Share Posted April 1, 2021 6 minutes ago, 55143681 said: The matter is : UnimPanel will occupy UnimLabel's position,why? Hello, What alignment are you using? Can you make a simple testcase to check? Link to comment Share on other sites More sharing options...
55143681 Posted April 1, 2021 Author Share Posted April 1, 2021 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 More sharing options...
55143681 Posted April 1, 2021 Author Share Posted April 1, 2021 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 More sharing options...
55143681 Posted April 1, 2021 Author Share Posted April 1, 2021 1 minute ago, 55143681 said: The alignmentControl is default,I think that will be uniAlignmentServer c_mdemo_p3c2_11.zip Link to comment Share on other sites More sharing options...
55143681 Posted April 1, 2021 Author Share Posted April 1, 2021 See this demo please,thanks. Unigui1546 +xe10.3.3 cbuilder testNewmLabel.zip Link to comment Share on other sites More sharing options...
55143681 Posted April 1, 2021 Author Share Posted April 1, 2021 4 minutes ago, 55143681 said: See this demo please,thanks. Unigui1546 +xe10.3.3 cbuilder testNewmLabel.zip 59.91 kB · 0 downloads e0a1ed0be24cdf299e475f6d13ee6b76.mp4 Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2021 Share Posted April 1, 2021 I first need to port this to Delphi. Link to comment Share on other sites More sharing options...
55143681 Posted April 2, 2021 Author Share Posted April 2, 2021 18 hours ago, Sherzod said: I first need to port this to Delphi. Here is delphi version,the problem is same. Help me please. testNewmLabel2.zip Link to comment Share on other sites More sharing options...
55143681 Posted April 2, 2021 Author Share Posted April 2, 2021 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 More sharing options...
55143681 Posted April 8, 2021 Author Share Posted April 8, 2021 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 More sharing options...
Sherzod Posted April 8, 2021 Share Posted April 8, 2021 1 hour ago, 55143681 said: Help me please:) Hello, Can you use uniAlignmentClient? Link to comment Share on other sites More sharing options...
Recommended Posts