Forum > Other
TPanel and it's bevel... / Dynamic Splitter
Adam.Pilorz:
Hello. I've tried to dynamicaly create a Panel, but unfortunately line like this:
Panel2.BevelInner:=bvNone;
ends with "Undeclared identifier: bvNone" error. I have unit Controls in my uses clause, and creating Panel works, but I can't set it's Bevel property. In Delphi such thing works. Why is that so?
Marc:
pfff... took me some time to firuge it out.
BevelInner is a TPanelBevelCut
TPanelBevelCut = TBevelCut (defined in ExtCtrls)
TBevelCut = TGraphicsBevelCut (defined in controls)
TGraphicsBevelCut is defined in GraphType and there also bvNone is defined.
So add uses GraphType.
Adam.Pilorz:
Hmm... Looks interesting :] Thanks for advice. And I have another question, maybe not exactly linked with the problem, but a bit... I'm creating TPanel, then I'm setting it as TreeView's parent. Then I'm setting it's align property to AlLeft. After that I'm creating a TSplitter on that panel, and too setting it's align as alLeft. After doing that, I'm craeting second panel on this first, and setting it's Align property to alClient. And it should look like that: On the left of the panel is TTreeView, next to it (on it's right side) a splitter and on the right of the splitter another panel. Unfortunately it doesn't look like it. The splitter is on the beggining on left side of the main panel, and after it a TreeView. What's wrong?
--- Code: --- Panel1:=TPanel.Create(ReceiveForm);
Panel1.Parent:=ReceiveForm;
Panel1.BevelInner:=bvNone;
Panel1.BevelOuter:=bvNone;
TreeView1.Parent:=Panel1;
TreeView1.Align:=alLeft;
Splitter1:=TSplitter.Create(Panel1);
Splitter1.Parent:=Panel1;
Splitter1.Align:=alLeft;
Splitter1.Width:=2;
Panel2:=TPanel.Create(Panel1);
Panel2.Parent:=Panel1;
Panel2.Align:=alClient;
Panel2.BevelInner:=bvNone;
Panel2.BevelOuter:=bvNone;
--- End code ---
Adam.Pilorz:
Well, I've tried several things and I've menaged to do it. But it needed creation of all components dynamicaly to work. Here's the smaple:
--- Code: --- Panel1:=TPanel.Create(ReceiveForm);
Panel1.Parent:=ReceiveForm;
Panel1.BevelInner:=bvNone;
Panel1.BevelOuter:=bvNone;
Splitter1:=TSplitter.Create(Panel1);
TreeView1:=TTreeView.Create(Panel1);
TreeView1.Parent:=Panel1;
Splitter1.Parent:=Panel1;
TreeView1.Align:=alLeft;
Splitter1.Align:=alLeft;
Splitter1.Width:=1;
Panel2:=TPanel.Create(Panel1);
Panel2.Parent:=Panel1;
Panel2.Align:=alClient;
Panel2.BevelInner:=bvNone;
Panel2.BevelOuter:=bvNone;
--- End code ---
But there still is a question how to do it, when one of components isn't dynamicaly created...
Vincent Snijders:
I tried creating it in the designer and it worked. Why did you follow a mixed (designer/code) strategy in your first example?
Navigation
[0] Message Index
[#] Next page