|
-
May 22nd, 2006, 12:45 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] Using Timer : Change position of Icon Drawn on Panel
Hi guys,
My core purpose of this post is to make animated search image by combining Computer & Search icons
I tried ImageReady and Flash to make Animated Gif but the Quality is pure.
Anyway, My code is as Under ...
VB Code:
Dim icoComputer as New Icon("E:\Icons\Computer.ico")
Dim icoSearch as New Icon("E:\Icons\Search.ico")
Dim X as Interger = 144
Dim Y as Integer = 44
Private Sub pnlBackGround_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pnlBackGround.Paint
e.Graphics.DrawIcon(icoComputer, X, Y)
e.Graphics.DrawIcon(icoSearch, X, Y) ' I want to change this X
End Sub
I know i have to use timer_tick event but how to used e (System.Windows.Forms.PaintEventArgs) in it. I tried to declare object of System.Windows.Forms.PaintEventArgs. But I can't change the position of Search icon.
Plz help yaar..
-
May 22nd, 2006, 06:47 PM
#2
Re: [2005] Using Timer : Change position of Icon Drawn on Panel
The arguments for each event handler are specific to that event. What you need to do is use your Tick event handler to set the values of certain variables that will control where the icons are drawn, then call Refresh or Invalidate on the form to raise the Paint event. In the Paint event handler you then use those variables you set to draw the icons. If you can specify just the area of the form that will be changing then Invalidate will be more efficient than Refresh.
-
May 22nd, 2006, 09:57 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] Using Timer : Change position of Icon Drawn on Panel
Thanks that's workin.
Last edited by Coool; May 22nd, 2006 at 10:07 PM.
-
May 22nd, 2006, 10:04 PM
#4
Re: [2005] Using Timer : Change position of Icon Drawn on Panel
Have you tried or are you just assuming that you can't do it? My instructions are fairly simple: set some variables in the Tick event handler, call Refresh or Invalidate, use those variables in the Paint event handler.
Edit: So I guess that you tried after all.
Last edited by jmcilhinney; May 22nd, 2006 at 10:10 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|