TabControl and ForeLayer

steedj

Member
Licensed User
Hello,

I made a program using tabcontrols. I need now to draw some graphics on one of the tabs. I can't manage to do it with forelayer.

Is there any other way to do it.

Thanks.
 

HARRY

Active Member
Licensed User
Longtime User
Hi,

I did a small test, added an image control (Image1) to a form (Form1) and specified an image to load into it. Then:

Tab1.New1("Form1",0,0,240,320)
Tab1.AddTabPage("Een")
Tab1.AddTabPage("Twee")
Tab1.AddTabPage("Drie")
Tab1.AddControl("Image1",2,30,30)
Form1.show

and it works. The image is shown on the third tab.

May be that this isn't your problem?

Harry
 

steedj

Member
Licensed User
Well, I've got no problem with images and other text control. What I precisely want to do is for example drawing a line or something, and afterward be able to remove it, on top of that image. That' s why I wanted to use forelayer.

here is an example:

Sub Globals
'Declare the global variables here.

End Sub

Sub App_Start

ongletPrincipal.New1("form1",1,1,480,770)
ongletPrincipal.AddTabPage("Principal")

form1.ForeLayer = True
drawer.New1("forme1",True)
grpAffAiguille (100,100,50,30,cBlack)
Form1.Show
End Sub

Sub grpAffAiguille (pCentreX, pCentreY, pLongueur, pAngle, pCouleur)

penAiguille.new1(pCouleur)
drawer.DrawLine(penAiguille.Value,pCentreX,pCentreY,pCentreX+Cos(DegreeEnRadian(pAngle))*pLongueur,pCentreY+Sin(DegreeEnRadian(pAngle))*pLongueur)
drawer.DrawLine(penAiguille.Value,100,100,50,50)
drawer.Refresh(0,0,300,300)
End Sub

Sub DegreeEnRadian (pDegree)

Return pDegree*cPI/180
End Sub

if I remove the tabcontrol, the program works well.
 

klaus

Expert
Licensed User
Longtime User
You can do it with an Image control and with the ImageLibEx.
You can drawing onto a bitmap and setting this bitmap as the Image control's image.

I suggest you to always use ImageLibEx instead of ImageLib, ImageLibEx has almost everything you need for drawing !

Attached a small test program showing several possibilities.

Best regards.
 

steedj

Member
Licensed User
Hi, Klaus

This exactly what I need. I didn't have this library because I' m still in v6.5 and not really up to date.

Many thanks for your help
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…