Picture images not clearing
Posted
#1
(In Topic #1130)
Enthusiast

Hope someone can help me I seem to have a slight problem on my hands.
as you are all know I am writing a EPoS application in Gambas. so when I Press Sub total I get my Tender Menu (see below)
<IMG src="https://www.algpos.co.uk/gambas/NPoS_1.png">
</IMG>so far this is all good. When the user Press F1 (Cash) they would see Image 2
<IMG src="https://www.algpos.co.uk/gambas/NPoS_2.png">
</IMG>BUT if a user cancels this menu some of the images are not clearing (as you can see in image 3)
<IMG src="https://www.algpos.co.uk/gambas/NPoS_3.png">
</IMG>I am using Picture1.picture = null (i did try the Picture.clear but Gambas was not happy with this even though the Help saying it clears the image)
Does anyone have any ideas what I would need to do so the images clear fully and the first menu is displayed again
Thanks for any advise anyone can offer men
Kind Regards
Andy
Posted
Guru

Posted
Guru

Posted
Enthusiast

cogier said
I have just tried this and it works OK. Does Picture1 refer to a PictureBox?
Yes sorry picture1 does refer to a picturebox.
I'll upload the code I'm using to clear the images when I'm in the office at 3pm (UK time today)
Posted
Guru

Code (gambas)
- PictureBox1 As PictureBox
- ToggleButton1 As ToggleButton
- .Height = 250
- .Width = 200
- .Arrangement = Arrange.Vertical
- .Padding = 5
- .Width = 200
- .Height = 28
- .Height = 28
- .Width = 200
- .Text = "&Delete image"
- ToggleButton1.Text = "&Add picture"
- ToggleButton1.Text = "&Delete image"
Posted
Enthusiast

AndyGable said
Yes sorry picture1 does refer to a picturebox.cogier said
I have just tried this and it works OK. Does Picture1 refer to a PictureBox?
I'll upload the code I'm using to clear the images when I'm in the office at 3pm (UK time today)
Apologies for the delay in sending this information I was sided tracked on another project
Below is the code i use to clear the labels / Pictures
Code (gambas)
- Global.MenuControl = ""
- With frmbackground
- .PicFunctionF1.Refresh
- .PicFunctionF2.Refresh
- .PicFunctionF3.Refresh
- .PicFunctionF4.Refresh
- .PicFunctionF5.Refresh
- .PicFunctionF6.Refresh
- .PicFunctionF7.Refresh
- .PicFunctionF8.Refresh
This is the code I am using to load the images in to the pictureboxes
Code (gambas)
- $Query &= "Select "
- $Query &= "keydescription, "
- $Query &= "keyvalue, "
- $Query &= "CAST(keyimage AS CHAR) AS keyimage "
- $Query &= "from quicktender "
- $Query &= "where keyactive='1' "
- $Query &= "order by keynumber ASC;"
- ' ConnectToDatabase
- Global.QuickTenderName[I] = QuickTenderResult!keydescription
- Global.QuicktenderValue[I] = QuickTenderResult!keyvalue
- Global.QuickTenderImage[I] = QuickTenderResult!keyimage
- QuickTenderResult.MoveNext
- ' Display Quick Tender options on the menu
- MenuDisplay.ClearMenu
- Global.MenuControl = "QuickTenderMenu"
- With frmbackground
- .labFunctionKeyF1.Caption = Global.QuickTenderName[0]
- Global.ImageFromString(Global.QuickTenderImage[0], frmbackground.PicFunctionF1)
- .labFunctionKeyF2.Caption = Global.QuickTenderName[1]
- Global.ImageFromString(Global.QuickTenderImage[1], frmbackground.PicFunctionF2)
- .labFunctionKeyF3.Caption = Global.QuickTenderName[2]
- Global.ImageFromString(Global.QuickTenderImage[2], frmbackground.PicFunctionF3)
- .labFunctionKeyF4.Caption = Global.QuickTenderName[3]
- Global.ImageFromString(Global.QuickTenderImage[3], frmbackground.PicFunctionF4)
- .labFunctionKeyF5.Caption = Global.QuickTenderName[4]
- Global.ImageFromString(Global.QuickTenderImage[4], frmbackground.PicFunctionF5)
- .labFunctionKeyF6.Caption = Global.QuickTenderName[5]
- Global.ImageFromString(Global.QuickTenderImage[5], frmbackground.PicFunctionF6)
- .labFunctionKeyF7.Caption = Global.QuickTenderName[6]
- Global.ImageFromString(Global.QuickTenderImage[6], frmbackground.PicFunctionF7)
- .labFunctionKeyF8.Caption = "Cancel"
And just incase it is needed here is the code I am using to load the acual image into the picturebox
I know this could be better written and optimized but at the moment I just want to sort the issues of the images not clearing.
1 guest and 0 members have just viewed this.



