求救:画线的控件是哪一个如何应用

Yujlyjl 2003-11-28 11:44:55
本人在CB中找不到画线控件,请大侠帮忙
...全文
52 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Yujlyjl 2003-11-29
  • 打赏
  • 举报
回复
blck(black) :请你说得细一些,没有找到.
gdyt007 2003-11-28
  • 打赏
  • 举报
回复
paintbox
tokens 2003-11-28
  • 打赏
  • 举报
回复
不是控件,是一个属性。。
canvas
alpha001001 2003-11-28
  • 打赏
  • 举报
回复
moveto,lineto
blck 2003-11-28
  • 打赏
  • 举报
回复
teechart
控件就可以啊
比如画直线Series1->Addxxy(x坐标,y坐标,"",clRED)就可以了啊
你可以看帮助的,bcb的example里面有
yjy1001 2003-11-28
  • 打赏
  • 举报
回复
偶这里 有一个 呵呵
CSDN BCB论坛里贴过(不是偶)——
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

#ifndef LineH
#define LineH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class PACKAGE TLine : public TGraphicControl
{
private:
int FLineWidth;
void __fastcall SetLineWidth(int value);

protected:
public:
__fastcall TLine(TComponent* Owner);
void __fastcall Paint();
__published:
__property int LineWidth = { read=FLineWidth, write=SetLineWidth };
__property OnClick;

};
//---------------------------------------------------------------------------
#endif


#include <vcl.h>
#pragma hdrstop

#include "Line.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//

static inline void ValidCtrCheck(TLine *)
{
new TLine(NULL);
}
//---------------------------------------------------------------------------
__fastcall TLine::TLine(TComponent* Owner)
: TGraphicControl(Owner)
{
FLineWidth=1;
}
//---------------------------------------------------------------------------
namespace Line
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TLine)};
RegisterComponents("Jiayodo", classes, 0);
}
}
//---------------------------------------------------------------------------
void __fastcall TLine::Paint()
{
//TODO: Add your source code here
TRect rt=this->ClientRect;
this->Canvas->Pen->Width=FLineWidth;
Canvas->MoveTo(0,0);
Canvas->LineTo(rt.right,rt.bottom);
}
void __fastcall TLine::SetLineWidth(int value)
{
//TODO: Add your source code here
if(FLineWidth!=value)
{
FLineWidth=value;
Invalidate();
}
}
win2000,BCB5.0 编写

551

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 茶馆
社区管理员
  • 茶馆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧