473,767 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to draw lines between two froms?

Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing function
in the blank area between two forms. I have looked up the MSDN, it says that
a graphics object need a reference to a control or a form. I guess it means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of the
mouse. The line should keep changing when the mouse is moving and the mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.
Feb 25 '07 #1
9 4027
Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the parent draw the line. Form1 and Form2 needs to be MDIChildren. The parent can then subscribe to the Move event, SizeChanged event or any other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing function
in the blank area between two forms. I have looked up the MSDN, it says that
a graphics object need a reference to a control or a form. I guess it means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of the
mouse. The line should keep changing when the mouse is moving and the mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.


--
Happy coding!
Morten Wennevik [C# MVP]
Feb 25 '07 #2
Thank you very much! I will try it later. However, is there any other
methods for drawing a line outside a form? Thanks!

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]

Feb 25 '07 #3
You can create a graphics object of the desktop and draw directly on thedesktop. To do this, use the Win32 method GetDC(hWnd). If you pass IntPtr.Zero you will get the handle to the desktop DC (device context). From this create a Graphics object using Graphics.FromHd c.

To use the Win32 method add

[DllImport("User 32.dll")]
public extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("User 32.dll")]
public extern static IntPtr ReleaseDC(IntPt r hWnd, IntPtr hDC);

To draw on the desktop use

IntPtr hDC = GetDC(IntPtr.Ze ro);
using(Graphics g = Graphics.FromHd c(hDC))
{
Graphics.DrawLi ne(Pens.Black, form1.Location, form2.Location) ;
}
ReleaseDC(IntPt r.Zero, hDC);

However, I would advice against drawing on the desktop and instead consider a MDI solution.
On Sun, 25 Feb 2007 17:42:34 +0100, nuber19 <nu*****@hotmai l.comwrote:
Thank you very much! I will try it later. However, is there any other
methods for drawing a line outside a form? Thanks!

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
>Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]




--
Happy coding!
Morten Wennevik [C# MVP]
Feb 25 '07 #4
Got it. Thank you very much!
"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobf80v jdj93y5@stone.. .
You can create a graphics object of the desktop and draw directly on the
desktop. To do this, use the Win32 method GetDC(hWnd). If you pass
IntPtr.Zero you will get the handle to the desktop DC (device context).
From this create a Graphics object using Graphics.FromHd c.

To use the Win32 method add

[DllImport("User 32.dll")]
public extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("User 32.dll")]
public extern static IntPtr ReleaseDC(IntPt r hWnd, IntPtr hDC);

To draw on the desktop use

IntPtr hDC = GetDC(IntPtr.Ze ro);
using(Graphics g = Graphics.FromHd c(hDC))
{
Graphics.DrawLi ne(Pens.Black, form1.Location, form2.Location) ;
}
ReleaseDC(IntPt r.Zero, hDC);

However, I would advice against drawing on the desktop and instead consider
a MDI solution.
On Sun, 25 Feb 2007 17:42:34 +0100, nuber19 <nu*****@hotmai l.comwrote:
Thank you very much! I will try it later. However, is there any other
methods for drawing a line outside a form? Thanks!

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
>Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]




--
Happy coding!
Morten Wennevik [C# MVP]
Feb 25 '07 #5
Hi, Morten,
I declare 3 forms, and set the mainform as

mainform.IsMdiC ontainer=true;

to make it can contain subform1 and subform2.Howeve r, It looks like a line
can not be drawn in a form which is a MDI container.I can only draw lines in
subform1 and subform2 by using Form_Paint event. Do you have any comments
about this? Thank you !
"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]

Feb 25 '07 #6
Sorry about that,

When you set a Form to IsMdiContainer = true you also create an MdiClient control which is added to the form. This control is the gray background you see. You need to subscribe to the MdiClient's Paint event and draw in the client surface.

The code below will draw a line between the upper left corner of the MdiParent and an MdiChild

MdiClient client = null;
Form1 f = new Form1();

public MDIParent()
{
InitializeCompo nent();

foreach (Control c in this.Controls)
{
if (c is MdiClient)
client = (MdiClient)c;
}

client.Paint += new PaintEventHandl er(client_Paint );

f.MdiParent = this;
f.Show();

f.Move += new EventHandler(f_ Move);
}

void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Black , new Point(0, 0), f.Location);
}

void f_Move(object sender, EventArgs e)
{
client.Invalida te();
}
On Sun, 25 Feb 2007 23:14:08 +0100, Joe Gallagher <nu*****@hotmai l.comwrote:
Hi, Morten,
I declare 3 forms, and set the mainform as

mainform.IsMdiC ontainer=true;

to make it can contain subform1 and subform2.Howeve r, It looks like a line
can not be drawn in a form which is a MDI container.I can only draw lines in
subform1 and subform2 by using Form_Paint event. Do you have any comments
about this? Thank you !
"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
>Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]




--
Happy coding!
Morten Wennevik [C# MVP]
Feb 26 '07 #7
Thank you very much for you reply!
According to you reply, I modified my codes, and it can draw line. However,
I want to make it draw line dynamically when the mouse is moving. But the
application can only draw a static line when it starts. I paste my related
code as below, please have a look at it if you have a second. I do not know
how to use the MDIParent Function in you code. I think it may be the reason.
Thank you in advance.

class MyApplicationCo ntext : ApplicationCont ext
{

private int formCount;
private Form1 mainform, subform1,subfor m2;
private var tvar = new var();
MdiClient client = null;
private int currx=0;
private int curry=0;

public MyApplicationCo ntext()
{
formCount = 0;
// Handle the ApplicationExit event to know when the application
is exiting.
mainform = new Form1();
mainform.SetBou nds(0, 0, 1280, 800);
mainform.IsMdiC ontainer=true;
foreach (Control c in mainform.Contro ls)
{
if (c is MdiClient)
client = (MdiClient)c;
}
client.Paint += new PaintEventHandl er(client_Paint );

subform1 = new Form1();
subform1.Closed += new EventHandler(On FormClosed);
subform1.SetDes ktopLocation(50 , 100);

subform1.change Text("Start");
subform1.button Show();
formCount++;
subform2 = new Form1();
subform2.Closed += new EventHandler(On FormClosed);
subform2.SetDes ktopLocation(60 0,100);
subform2.change Text("Stop");
subform2.button Show();
formCount++;
subform1.MdiPar ent = mainform;
subform2.MdiPar ent = mainform;

// Show both forms.
mainform.Show() ;
mainform.MouseM ove += new MouseEventHandl er(Form_Move);
mainform.MouseH over += new EventHandler(Fo rm_Move2);
subform1.Show() ;
subform2.Show() ;
}
void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Red,2 00,300,currx,cu rry);
}

void Form_Move(objec t sender, MouseEventArgs e)
{
currx = Control.MousePo sition.X;
curry = Control.MousePo sition.Y;
client.Invalida te();
}
void Form_Move2(obje ct sender, EventArgs e)
{
currx = Control.MousePo sition.X;
curry = Control.MousePo sition.Y;
client.Invalida te();
}

private void OnFormClosed(ob ject sender, EventArgs e)
{
// When a form is closed, decrement the count of open forms.

// When the count gets to 0, exit the app by calling
// ExitThread().
formCount--;
if (formCount == 0)
{
tvar.close();
ExitThread();
}
}
}
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Ena bleVisualStyles ();
Application.Set CompatibleTextR enderingDefault (false);
MyApplicationCo ntext context = new MyApplicationCo ntext();
Application.Run (context);
}
}

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.todbhrk 4dj93y5@stone.. .
Sorry about that,

When you set a Form to IsMdiContainer = true you also create an MdiClient
control which is added to the form. This control is the gray background you
see. You need to subscribe to the MdiClient's Paint event and draw in the
client surface.

The code below will draw a line between the upper left corner of the
MdiParent and an MdiChild

MdiClient client = null;
Form1 f = new Form1();

public MDIParent()
{
InitializeCompo nent();

foreach (Control c in this.Controls)
{
if (c is MdiClient)
client = (MdiClient)c;
}

client.Paint += new PaintEventHandl er(client_Paint );

f.MdiParent = this;
f.Show();

f.Move += new EventHandler(f_ Move);
}

void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Black , new Point(0, 0), f.Location);
}

void f_Move(object sender, EventArgs e)
{
client.Invalida te();
}
On Sun, 25 Feb 2007 23:14:08 +0100, Joe Gallagher <nu*****@hotmai l.com>
wrote:
Hi, Morten,
I declare 3 forms, and set the mainform as

mainform.IsMdiC ontainer=true;

to make it can contain subform1 and subform2.Howeve r, It looks like a line
can not be drawn in a form which is a MDI container.I can only draw lines
in
subform1 and subform2 by using Form_Paint event. Do you have any comments
about this? Thank you !
"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbosd rdj93y5@stone.. .
>Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:
>>Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.

--
Happy coding!
Morten Wennevik [C# MVP]




--
Happy coding!
Morten Wennevik [C# MVP]
Feb 27 '07 #8
I checked it again and think that It may because subform1 and subform2 are
above the mainform, then the main form can not get focus..So it can only
draw a line at the beginning.
"Joe Gallagher" <nu*****@hotmai l.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Thank you very much for you reply!
According to you reply, I modified my codes, and it can draw line.
However, I want to make it draw line dynamically when the mouse is moving.
But the application can only draw a static line when it starts. I paste my
related code as below, please have a look at it if you have a second. I do
not know how to use the MDIParent Function in you code. I think it may be
the reason. Thank you in advance.

class MyApplicationCo ntext : ApplicationCont ext
{

private int formCount;
private Form1 mainform, subform1,subfor m2;
private var tvar = new var();
MdiClient client = null;
private int currx=0;
private int curry=0;

public MyApplicationCo ntext()
{
formCount = 0;
// Handle the ApplicationExit event to know when the
application is exiting.
mainform = new Form1();
mainform.SetBou nds(0, 0, 1280, 800);
mainform.IsMdiC ontainer=true;
foreach (Control c in mainform.Contro ls)
{
if (c is MdiClient)
client = (MdiClient)c;
}
client.Paint += new PaintEventHandl er(client_Paint );

subform1 = new Form1();
subform1.Closed += new EventHandler(On FormClosed);
subform1.SetDes ktopLocation(50 , 100);

subform1.change Text("Start");
subform1.button Show();
formCount++;
subform2 = new Form1();
subform2.Closed += new EventHandler(On FormClosed);
subform2.SetDes ktopLocation(60 0,100);
subform2.change Text("Stop");
subform2.button Show();
formCount++;
subform1.MdiPar ent = mainform;
subform2.MdiPar ent = mainform;

// Show both forms.
mainform.Show() ;
mainform.MouseM ove += new MouseEventHandl er(Form_Move);
mainform.MouseH over += new EventHandler(Fo rm_Move2);
subform1.Show() ;
subform2.Show() ;
}
void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Red,2 00,300,currx,cu rry);
}

void Form_Move(objec t sender, MouseEventArgs e)
{
currx = Control.MousePo sition.X;
curry = Control.MousePo sition.Y;
client.Invalida te();
}
void Form_Move2(obje ct sender, EventArgs e)
{
currx = Control.MousePo sition.X;
curry = Control.MousePo sition.Y;
client.Invalida te();
}

private void OnFormClosed(ob ject sender, EventArgs e)
{
// When a form is closed, decrement the count of open forms.

// When the count gets to 0, exit the app by calling
// ExitThread().
formCount--;
if (formCount == 0)
{
tvar.close();
ExitThread();
}
}
}
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Ena bleVisualStyles ();
Application.Set CompatibleTextR enderingDefault (false);
MyApplicationCo ntext context = new MyApplicationCo ntext();
Application.Run (context);
}
}

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.todbhrk 4dj93y5@stone.. .
Sorry about that,

When you set a Form to IsMdiContainer = true you also create an MdiClient
control which is added to the form. This control is the gray background
you see. You need to subscribe to the MdiClient's Paint event and draw in
the client surface.

The code below will draw a line between the upper left corner of the
MdiParent and an MdiChild

MdiClient client = null;
Form1 f = new Form1();

public MDIParent()
{
InitializeCompo nent();

foreach (Control c in this.Controls)
{
if (c is MdiClient)
client = (MdiClient)c;
}

client.Paint += new PaintEventHandl er(client_Paint );

f.MdiParent = this;
f.Show();

f.Move += new EventHandler(f_ Move);
}

void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Black , new Point(0, 0), f.Location);
}

void f_Move(object sender, EventArgs e)
{
client.Invalida te();
}
On Sun, 25 Feb 2007 23:14:08 +0100, Joe Gallagher <nu*****@hotmai l.com>
wrote:
>Hi, Morten,
I declare 3 forms, and set the mainform as

mainform.IsMdi Container=true;

to make it can contain subform1 and subform2.Howeve r, It looks like a
line
can not be drawn in a form which is a MDI container.I can only draw lines
in
subform1 and subform2 by using Form_Paint event. Do you have any comments
about this? Thank you !
"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:op.tobbos drdj93y5@stone. ..
>>Hi,

If Form1 and Form2 both reside inside a parent form (MDIParent) have the
parent draw the line. Form1 and Form2 needs to be MDIChildren. The
parent can then subscribe to the Move event, SizeChanged event or any
other event that may cause a need to redraw the line.

On Sun, 25 Feb 2007 16:19:04 +0100, zhaow <nu*****@hotmai l.comwrote:

Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing
function
in the blank area between two forms. I have looked up the MSDN, it says
that
a graphics object need a reference to a control or a form. I guess it
means
that lines can't be draw on blank area between two forms. Can anybody
guarantee this for me? Is there any method can realize this function? I
mainly want to draw a line from a button in form1 to current position
of
the
mouse. The line should keep changing when the mouse is moving and the
mouse
will sure move outside the form1 to the form2.
Thank you in advance for your time and patient.


--
Happy coding!
Morten Wennevik [C# MVP]



--
Happy coding!
Morten Wennevik [C# MVP]

Feb 27 '07 #9
It is not so interesting when the mouse moves as when the forms move. Ihave changed your code to draw a point between the upper left corner ofsubform1 and subform2 based on subform1.Move and subform2.Move.

class MyApplicationCo ntext : ApplicationCont ext
{

private int formCount;
private Form1 mainform, subform1, subform2;
//private var tvar = new var();
MdiClient client = null;
Point p1 = Point.Empty;
Point p2 = Point.Empty;

public MyApplicationCo ntext()
{
formCount = 0;
// Handle the ApplicationExit event to know when the application is exiting.
mainform = new Form1();
mainform.SetBou nds(0, 0, 1280, 800);
mainform.IsMdiC ontainer=true;
foreach (Control c in mainform.Contro ls)
{
if (c is MdiClient)
client = (MdiClient)c;
}
client.Paint += new PaintEventHandl er(client_Paint );

subform1 = new Form1();
subform1.Closed += new EventHandler(On FormClosed);
subform1.SetDes ktopLocation(50 , 100);

//subform1.change Text("Start");
//subform1.button Show();
formCount++;
subform2 = new Form1();
subform2.Closed += new EventHandler(On FormClosed);
subform2.SetDes ktopLocation(60 0,100);
//subform2.change Text("Stop");
//subform2.button Show();
formCount++;
subform1.MdiPar ent = mainform;
subform2.MdiPar ent = mainform;

// Show both forms.
mainform.Show() ;
subform1.Move += new EventHandler(Fo rm_Move);
subform2.Move += new EventHandler(Fo rm_Move);
subform1.Show() ;
subform2.Show() ;
}
void client_Paint(ob ject sender, PaintEventArgs e)
{
e.Graphics.Draw Line(Pens.Red, p1, p2);
}

void Form_Move(objec t sender, EventArgs e)
{
p1 = subform1.Locati on;
p2 = subform2.Locati on;
client.Invalida te();
}

private void OnFormClosed(ob ject sender, EventArgs e)
{
// When a form is closed, decrement the count of open forms..

// When the count gets to 0, exit the app by calling
// ExitThread().
formCount--;
if (formCount == 0)
{
//tvar.close();
ExitThread();
}
}
}
--
Happy coding!
Morten Wennevik [C# MVP]
Feb 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2506
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as you see below. Please advise! Thanks! #include <iostream> using namespace std;
0
3786
by: awan | last post by:
hi, I wanna migrate 6i forms to 10g forms....I compiled 6i forms in 10g form builder ,froms compiled successfully and add some settings in fromsweb file....which is as follows: #http://http://awan.rdcci.org.sa:8889/forms/frmservlet?config=train1 #D:\DevSuiteHome_1\forms\server *** copy formsweb.cfg file in this directory #D:\DevSuiteHome_1\forms\java *** copy GIF files in this directory ( icons for toolbar ) ...
5
6494
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as you see below. Please advise! Thanks! #include <iostream> using namespace std;
4
734
by: Mathieu Chavoutier | last post by:
Hi. I would like to do something like paint. I try to draw a line. I want, like paint, that when I clickdown, it begins to draw the line, and then, when I move the mouse, the line follow the cursor. I have tried many things, and I have mysterious things appening. Here, I can't remove the lines I have drawed : http://img26.exs.cx/img26/4302/GRRRRRRRRRRRR.png
7
10692
by: Mark Ingram | last post by:
Hi, how can i draw a rounded rectange, with a border within a specified area? i.e. if i have a Rectangle with width and height of 100, how can i draw a rectange with 2 pixel border inside of the original one? (the current attempts all draw the border just outside of the original rectangle). At the moment im using the following code, but it allows the rectangle to grow - which i definately dont want!
10
4638
by: wazzup | last post by:
C++ is new to me and I'm trying solve this problem but get stuck. Please help me out. Below is the task and after that is what i got so far. Create a program to print nested squares Input: Accept the width of the largest square Output: A series of nested squares with 1 space between them Sample: > eca4.exe 10 ********** * * * ****** *
4
9206
by: hastalavista | last post by:
HI I'm very new to C# and I've got a big project to do in C# for uni until july. I've been trying do draw lines in C# (arrows to be precise). I can draw them allright but once I minimize the program and maximize it again, the arrows dissapear :S. this also happens if I open another program on top of the program I'm creating. Is their a way to correct this? To draw the lines I've been using this piece of code.
8
2307
by: Anuhas | last post by:
Dear experts, I have used buttons to indicate certain locations on a map.(Just a picture used as form background) I am going to draw lines interconnecting these buttons(locations). But I dont know how to draw lines connecting those buttons. Can I draw lines using coordinate systems? Please help me soon to solve this problem.
0
968
by: Anuhas | last post by:
Dear Experts, I need to draw lines. But I have to make a class for this. I know how to draw lines in direct methods. i.e. Graphics g = this.CreateGraphics(); Pen mypen = new Pen(Color.Red, 2); mypen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; g.DrawLine(mypen, 100, 100, 200, 300);
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.