BeneBarros Active Member Licensed User Longtime User Nov 24, 2019 #1 Is there any way to change Mainform.icon at runtime?
A amykonio Active Member Licensed User Longtime User Nov 24, 2019 #2 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.
BeneBarros Active Member Licensed User Longtime User Nov 24, 2019 #3 amykonio said: 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. Click to expand... thanks, but i need to change the icon at runtime. This function does not change the icon on the taskbar. Upvote 0
amykonio said: 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. Click to expand... thanks, but i need to change the icon at runtime. This function does not change the icon on the taskbar.
Erel B4X founder Staff member Licensed User Longtime User Nov 24, 2019 #4 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 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
BeneBarros Active Member Licensed User Longtime User Nov 24, 2019 #5 Erel said: 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 Click to expand... Thank you ,,, it works perfectly. Upvote 0
Erel said: 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 Click to expand... Thank you ,,, it works perfectly.