imagebox


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: imagebox

  1. #1
    Join Date
    Mar 2005
    Posts
    110

    imagebox

    hi,

    I have solved the problem that show more than image at the same time by dynamicly adding the imagebox control.

    this is my code:

    rs.Open "select Location from Image where image='" & Text1(0).Text & "' ", cnn, adOpenStatic

    If rs.EOF Then Exit Sub

    If Not rs.EOF Then rs.MoveFirst

    For i = 1 To rs.RecordCount
    If rs.Fields("location").Value <> "" Then
    Load Image2(i)
    Image2(i).Visible = True
    Image2(i).Top = Image2(0).Top + Image2(0).Height * i + 40 * i
    Image2(i).Picture = LoadPicture(rs.Fields("location").Value)

    End If
    rs.MoveNext
    Next i

    now I have another question, I want to let the imagebox change the color or something when the mouse click it,so end-user know the imagebox chosed.

    And then I can capture this action and do next step.

    My question:
    1.how to change the imagebox color or sth
    2.how to capture the action


    thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    there is not much you can do with an Image control besides loading an Image. But you can use the BorderStyle property to mark a selected Image. Set the BorderStyle to 0 (no border) and change it in the Click event (and remember to reset it for the previously selected Image) If you want something more fancy, you can draw a rectangle around the Image using the Line method of the Form object (this is more tricky because you have to redraw it in the form Paint event)

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    You can use the 'shape' control to make a box, rather than drawing 4 lines...

  4. #4
    Join Date
    Mar 2005
    Posts
    110
    Thanks for help

    aleady done


  5. #5
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    Quote Originally Posted by RHelliwell
    You can use the 'shape' control to make a box, rather than drawing 4 lines...
    true. then the box can be moved at the location of the selected image. very nice idea, I like it!
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center