[Gambas-user] How to set the icon property of a form from a file in the project

Kende Krisztián nemh at ...2007...
Mon Dec 16 12:49:44 CET 2013


2013-12-16 11:52 keltezéssel, John Rose írta:
> I want to set the FMain form's icon property (in the FMain Form_Open
> sub) to the picture contained in a .png file which I've added to to the
> Data section (of the Gambas IDE). Here is my non-working code, which
> gives 'Null Object' at runtime:
>     Dim picIcon As Picture
>     picIcon.Load("StreamRecorder.png")
>     FMain.Icon = picIcon
>
> What do I change?
>
> PS the app is also called StreamRecorder.
>

FMain.Icon = Picture["StreamRecorder.png"]

Or

Dim picIcon As Picture = Picture["StreamRecorder.png"]
FMain.Icon = picIcon

Or

Dim picIcon As Picture
picIcon = Picture["StreamRecorder.png"]
FMain.Icon = picIcon


Kendek





More information about the User mailing list