A
aaben
Unregistered / Unconfirmed
GUEST, unregistred user!
以下程序绘制两个圆,奇怪的是他们的基点不同,
一个是在PANEL1上绘,另一个则在FORM1上绘,为什么会有这种情况?
如果将RELEASE或TEST.ENABLED:=FALSE句去掉,则正常.
(TEST是主菜单项), 请高手指点.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Menus;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
test: TMenuItem;
Panel1: TPanel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var mydc:hdc;
begin
mydc:=getdc(panel1.handle);
releasedc(handle,mydc);
test.enabled:=false;
ellipse(getdc(panel1.handle),20,20,50,50);
ellipse(mydc,30,30,60,60);
end;
一个是在PANEL1上绘,另一个则在FORM1上绘,为什么会有这种情况?
如果将RELEASE或TEST.ENABLED:=FALSE句去掉,则正常.
(TEST是主菜单项), 请高手指点.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Menus;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
test: TMenuItem;
Panel1: TPanel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var mydc:hdc;
begin
mydc:=getdc(panel1.handle);
releasedc(handle,mydc);
test.enabled:=false;
ellipse(getdc(panel1.handle),20,20,50,50);
ellipse(mydc,30,30,60,60);
end;