Le 30/11/2012 16:04, Willy Raets a écrit :
> Hi,
>> I've this form with a Panel and in there some TextBoxes, PictureBoxes
> and some Buttons.
> Button opens a Dialog to browse for PNG files and when selected show use
> the Dialog.Path to load the PNG into PictureBox (using PicBox.Picture =
> Picture.Load(Dialog.Path))
>> At a certain moment I want to clear the form and have this little
> rountine:
>> Public Sub PanelClear()
>> TextBox1.Clear> TextBox2.Clear> PictureBox1.Picture.Clear> PictureBox2.Picture.Clear> Me.Refresh
>> End
>> TextBoxes clear properly, but PictureBoxes don't.
> The loaded PNG stays visible in the PictureBox.
>> If one of the PictureBoxes has no loaded picture in there on clearing an
> error is generated because of it being Null.
>> 1. How do I get the PictureBoxes cleared of the shown picture?
> Am I using Clear wrongly? Also tried PictureBox1.Picture.Flush with no
> success.
>> 2. How test for a empty PictureBox?
> I tried testing with IsNull(PictureBox.Picture), but that doesn't seem
> to do the job.
>> Any suggestions that might get me on the road again?
>> Running Gambas 3.3.4 on Linux Mint 13 - Mate desktop
> Using gb.qt4 in the project.
>> Willy
>
PictureBox1.Picture = Null
PictureBox1.Picture.Clear only clears the contents of the picture
returned by the property, which is somewhat a copy of the internal
picture of the PictureBox which stays unchanged.
Regards,
--
Benoît Minisini