不知道我在这里做错了什么
//update controls from main form Tshape
form2.cbxShape.ItemIndex:= ord(Shape1.Shape);
form2.cbxColor.Selected:= Shape1.Brush.Color;
form2.cbxStyle.ItemIndex:= Ord(Shape1.Brush.Style);
if form2.ShowModal = mrOK then
begin
//update main form Tshape from controls
Shape1.Shape:= TShapeType(form2.cbxShape.ItemIndex);
Shape1.Brush.Color:= form2.cbxColor.Selected;
Shape1.Brush.Style:= TBrushStyle(form2.cbxStyle.ItemIndex);
end;
我没有得到正确的形状或画笔样式(颜色效果很好)
列表框项如下:
Circle
Ellipse
Rectangle
RoundRect
RoundSquare
Square
和
BDiagonal
Clear
Cross
DiagCross
FDiagonal
Horizontal
Solid