 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Angel Dimitrov Guest
|
Posted: Tue Nov 02, 2004 4:58 pm Post subject: Drawing from other Form |
|
|
I have the next problem:
There is Form1 and Form2. I want when I press a button on Form2 to be
drawn a line on Form1.
How to do this?
I tried with Form1->Canvas->LineTo & MoveTo but
it said "Undefined Symbol "Form1".
Please write me on:
stormlaboratory @ yahoo . com
Thanks in advance!
Angel Dimitrov
##########################################################
Unit1.cpp:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//my
#include <Unit2.cpp>
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form2->ShowModal();
}
//---------------------------------------------------------------------------
##########################################################
Unit2.cpp:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
Form1->Canvas->Pen->Color=RGB(0,0,0);
Form1->Canvas->LineTo(0,0);
Form1->Canvas->MoveTo(100,100);
}
//---------------------------------------------------------------------------
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|