| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Dec 30, 2008 10:21 pm Post subject: [SOLVED] Icon Element Help |
|
|
Hi All,
I need to change an Ico at runtime and I writed this sample
but not change icon and tooltip text
Why? What I wrong?
| Code: |
DIALOG CREATE,Change Icon Test,-1,0,240,160
DIALOG ADD,BITMAP,Icon,52,110,32,32,@Path(%0)PRINT.ICO,ToolTip,CLICK,HAND
DIALOG SHOW
:Loop
Wait Event
%%Event = @Event()
Goto %%Event
:IconClick
%%NewIco = @FileDlg(Icons|*.ico|,Chose New Icon)
If %%NewIcon
Dialog SetTip,Icon,%%NewIco
Dialog Set,Icon,%%NewIcon
End
Goto Loop
:Close
|
Many tnx for any info
Last edited by Tdk161 on Sun Jan 04, 2009 2:49 am; edited 1 time in total |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 31, 2008 5:07 am Post subject: |
|
|
Tdk161,
If this is your actual code, the "IF" statement needs to check %%NewIco instead of %%NewIcon and you have the same issue with "Dialog set,Icon,%%NewIcon"
Try this:
| Code: | DIALOG CREATE,Change Icon Test,-1,0,240,160
DIALOG ADD,BITMAP,Icon,52,110,32,32,@Path(%0)PRINT.ICO,ToolTip,CLICK,HAND
DIALOG SHOW
:Loop
Wait Event
%%Event = @Event()
Goto %%Event
:IconClick
%%NewIco = @FileDlg(Icons|*.ico|,Chose New Icon)
If %%NewIco
Dialog SetTip,Icon,%%NewIco
Dialog Set,Icon,%%NewIco
End
Goto Loop
:Close |
|
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Jan 02, 2009 12:03 am Post subject: |
|
|
I writed sample wrong,
this is the right source code sorry
| Code: | %%TIco = @FileDlg("File Icona (*.ico)|*.ico",Selezionare l' icona)
If %%TIco
%%Icona = %%TIco
# info %%Icona
Dialog Set,Icona,%%Icona
Dialog SetTip,Icona,%%Icona
%%DaSalvare = 1
End |
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri Jan 02, 2009 12:26 am Post subject: |
|
|
The following works on both my PCs (XP and Vista)
| Code: | DIALOG CREATE,Change Icon Test,-1,0,240,160
DIALOG ADD,BITMAP,Icona,52,110,32,32,@Path(%0)PRINT.ICO,ToolTip,CLICK,HAND
DIALOG SHOW
:Loop
Wait Event
%%Event = @Event()
Goto %%Event
:IconaClick
%%TIco = @FileDlg("File Icona (*.ico)"|*.ico,Selezionare l' icona)
If %%TIco
%%Icona = %%TIco
Dialog SetTip,Icona,%%Icona
Dialog Set,Icona,%%Icona
%%DaSalvare = 1
End
Goto Loop
:Close
exit |
|
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Jan 02, 2009 1:16 pm Post subject: |
|
|
WORK!!!
Many Tnx Asian
Only swap two line and work.....why? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|