Hi.
I have a problem with drawing on forms.
I use a form (with showdialog) to add forms in a main form that is shown behind the showdialog form.
The problem is that when i use the graphics.drawline to draw lines between the forms, it only works AFTER i close the showdialog form.
(meaning that if i use the function again when i close the dialogform, then it works)
.
I see that it works when i use the function to draw the forms inside the main forms Paint event.
I don't wanna do that cuz i use other functions to draw, when a form is moved or resized. Think of it like the Relationship lines in an Office-Access Application.
Bottom line is, how can i make a line show at the main form when i call it from my showdialog form, WITHOUT having to use mainforms Paintevent.
P.S.
I use painteventargs in my functions in order to draw the lines like this:
it works(when the showdialog form is active) only when i put the function to run from the mainforms Paint event and not when i call it individually.
I have a problem with drawing on forms.
I use a form (with showdialog) to add forms in a main form that is shown behind the showdialog form.
The problem is that when i use the graphics.drawline to draw lines between the forms, it only works AFTER i close the showdialog form.
(meaning that if i use the function again when i close the dialogform, then it works)
.
I see that it works when i use the function to draw the forms inside the main forms Paint event.
I don't wanna do that cuz i use other functions to draw, when a form is moved or resized. Think of it like the Relationship lines in an Office-Access Application.
Bottom line is, how can i make a line show at the main form when i call it from my showdialog form, WITHOUT having to use mainforms Paintevent.
P.S.
I use painteventargs in my functions in order to draw the lines like this:
VB.NET:
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] DrawLinePoint([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] PaintEventArgs, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] pMain [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Point, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] pSec [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Point)
[/SIZE][SIZE=2][SIZE=2]e.Graphics.DrawLine([/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Pen(Color.Black), pMain, pSec)
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[/SIZE]