forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[SOLVED] Icon Element Help

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Tue Dec 30, 2008 10:21 pm    Post subject: [SOLVED] Icon Element Help Reply with quote

Hi All,

I need to change an Ico at runtime and I writed this sample
but not change icon and tooltip text Crying or Very sad

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
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Dec 31, 2008 5:07 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Jan 02, 2009 12:03 am    Post subject: Reply with quote

Embarassed 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
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Fri Jan 02, 2009 12:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Jan 02, 2009 1:16 pm    Post subject: Reply with quote

Very Happy Very Happy Very Happy WORK!!!

Many Tnx Asian

Only swap two line and work.....why?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group