Results 1 to 5 of 5

Thread: How to display Text and Image in DataGridView Cell

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    54

    Arrow How to display Text and Image in DataGridView Cell

    My program parses chat room text. In the room there are smileys that get displayed. What I'm trying to do is parse out the image URL, download the image and put the smiley in the correct spot between the text of the message.

    I can do the parsing and downloading of the image into the datagridview but this only works of the column is set as an image column. Obviously due to the nature of the program I need to be able to put both text and images into the same cell. How can I do this?

    I searched the forum with no luck in regards to an answer to this question. Any help is greatly appreciated.

    Thank you.

  2. #2

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    54

    Re: How to display Text and Image in DataGridView Cell

    The thread has been knocked off to the second page. Bumping in hopes that other people will see it, thank you.

  3. #3
    Addicted Member Cimperiali's Avatar
    Join Date
    Oct 2002
    Location
    Milan, Italy, Europe
    Posts
    188

    Re: How to display Text and Image in DataGridView Cell

    you should draw it overriding the paint event.
    ie:
    http://msdn.microsoft.com/en-us/library/7fb61s43.aspx
    Special thanks to some wonderful people,
    such as Lothar the Great Haensler, Aaron Young,
    dr_Michael, Chris Eastwood, TheOnlyOne ClearCode....

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    54

    Re: How to display Text and Image in DataGridView Cell

    Can you give me any instruction as how to use that. I put that code in and I automatically get errors.

    Error 1 sub 'Paint' cannot be declared 'Overrides' because it does not override a sub in a base class.

    Error 2 'Public Event Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.

    I really appreciate your response.

    [Edit]
    I see there is more code but I have no clue about this. All of this is rollover which is drawing things for the cell boarder. What I need is an image inbetween two strings of text.
    Last edited by MadDokK; Mar 24th, 2010 at 08:05 PM.

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    54

    Re: How to display Text and Image in DataGridView Cell

    Got bumped to the second page again. You would think that Microsoft would have made this easy...

    Well maybe it is but I'm just too inexperienced

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width