B4J Question Mainform.Icon

Hi.
I put an icon in files.
Then create a button where I put the following code:
Code:
MainForm.Icon = fx.LoadImage(File.DirAssets, "x.png")

Also, I've tested and it works if instead of file.dirassets I use a path...
Code:
    MainForm.Icon = fx.LoadImage("/Develop/B4J/LoansCollection/Files", "DataEntry.png")

Andreas.
 
Upvote 0
Hi.
I put an icon in files.
Then create a button where I put the following code:
Code:
MainForm.Icon = fx.LoadImage(File.DirAssets, "x.png")

Also, I've tested and it works if instead of file.dirassets I use a path...
Code:
    MainForm.Icon = fx.LoadImage("/Develop/B4J/LoansCollection/Files", "DataEntry.png")

Andreas.
thanks, but i need to change the icon at runtime.
This function does not change the icon on the taskbar.
 
Upvote 0
It does change the task bar icon. Tested with this code:
Code:
'BitmapCreator and XUI
Dim bc As BitmapCreator
bc.Initialize(32, 32)
For i = 1 To 100
   bc.DrawRect(bc.TargetRect, Rnd(0xff000000, -1), True, 0)
   MainForm.Icon = bc.Bitmap
   Sleep(1000)
Next
Thank you ,,, it works perfectly.
 
Upvote 0
Back
Top