Problem in blinking an icon.....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumuka
    New Member
    • Oct 2007
    • 38

    Problem in blinking an icon.....

    Hello,

    I'm doing a vb project which contains some data in flexgrid the data in the flexgrid can change upon each and every execution . Now each data in the grid correspond to one particular icon in the form so when the user clicks on the grid i want that particular icon to start blinking .I'm not able to achieve it .Plz can someone help me out .

    Thanks & regards,
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Two questions...

    What version of VB are you using?

    What have you tried so far? I expect a timer control would be the way to go.

    Comment

    • sumuka
      New Member
      • Oct 2007
      • 38

      #3
      Originally posted by Killer42
      Two questions...

      What version of VB are you using?

      What have you tried so far? I expect a timer control would be the way to go.

      Thanks for having look at my question and replying.

      I'm using VB 6.0 i have used timer by setting its interval as 500 but the problem is a single number in the flexgrid can correspond to more than one icon in the diagram for ex: assume that the first cell of the flexgrid contains no 6 and it may correspond to 4 icons , now when the user clicks the cell which contain 6 i want all the 4 icons to start blinking simultaneously. I have used picture box to paste the icon.

      regards,

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        I don't know enough about your situation to make many suggestions. But if I have a form where I want to do something like blink a number of controls, what I like to do is flag them with some string in their Tag property. The timer just has to loop through the controls on the form checking their Tag and when it finds that string, do the "blinking" thing to that control. That may mean turning its visibility on/off, or changing its colours, or whatever.

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          See if this helps...

          It makes the button flash like crazy!

          [CODE=vbnet]Public Class Form1
          Dim a As String = 0
          Dim b as integer
          Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As System.EventArg s) Handles Timer1.Tick
          If a = 0 Then
          Button2.Visible = False
          a = 1
          Exit Sub
          End If
          If a = 1 Then
          Button2.Visible = True
          a = 0
          Exit Sub
          End If
          End Sub
          End Class[/CODE]

          You use this button to stop/start it flashing....
          [CODE=vbnet]Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
          If b = 2 Then
          b = 0
          Exit Sub
          End If
          If b = 0 Then
          b = 2
          Button2.Visible = True
          Exit Sub
          End If
          End Sub[/CODE]
          Last edited by Killer42; Oct 6 '07, 02:13 AM.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by jamesd0142
            See if this helps...
            sumuka, note that this is VB.Net code and won't work in VB6.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Here's a working sample written in VB6. Just load it into VB6 and run it. There's not much code, and it has comments to show what's what.

              I've also included the EXE for anyone who just wants to try running it. As far as I know it's virus free and so on, but take the usual precautions, of course.
              Attached Files
              Last edited by Killer42; Oct 6 '07, 02:35 AM.

              Comment

              • jamesd0142
                Contributor
                • Sep 2007
                • 471

                #8
                That's good Killer, think you can post the code as I don't have VB6 only VB.Net?

                Thanks.
                Last edited by Killer42; Oct 7 '07, 04:49 AM.

                Comment

                • Killer42
                  Recognized Expert Expert
                  • Oct 2006
                  • 8429

                  #9
                  Originally posted by jamesd0142
                  think you can post the code as i dont have vb6 only vb.net?
                  I did. It's in the zip file.

                  Comment

                  • sumuka
                    New Member
                    • Oct 2007
                    • 38

                    #10
                    Originally posted by Killer42
                    Here's a working sample written in VB6. Just load it into VB6 and run it. There's not much code, and it has comments to show what's what.

                    I've also included the EXE for anyone who just wants to try running it. As far as I know it's virus free and so on, but take the usual precautions, of course.

                    Thank you for your interest. The problem here is I have a flex grid whose cells contain one or the other number and when I click on the number I want the corresponding icon to blink automatically. Each and every number is connected with one or the other icon on the form.
                    Please help me.


                    Thanks in anticipation,
                    Sumuka.
                    Last edited by Killer42; Oct 11 '07, 09:57 PM.

                    Comment

                    • QVeen72
                      Recognized Expert Top Contributor
                      • Oct 2006
                      • 1445

                      #11
                      Hi,

                      What is stored in FlexGrid Cell...?
                      Index Number of the Icons(What Character Seperates them)..?
                      List of Icon Names?
                      Can you post the Cells's TextMatrix here ..?

                      Regards
                      Veena

                      Comment

                      • Killer42
                        Recognized Expert Expert
                        • Oct 2006
                        • 8429

                        #12
                        Originally posted by sumuka
                        Thank you for your interest. The problem here is I have a flex grid ...
                        Sorry, but I just can't seem to understand exactly what it is you want us to help with. Can you try to go into more detail, or show us what you have tried? Just stating the situation again and again won't help, we need to know more about precisely what you have, and what you want to do with it.

                        For instance, in what way are the icons "connected" with the grid cells?

                        Comment

                        Working...