Click here to Skip to main content
15,919,028 members
Home / Discussions / C#
   

C#

 
Questionusing nonstatic function in thread Pin
EEmaan12-Mar-07 18:07
EEmaan12-Mar-07 18:07 
AnswerRe: using nonstatic function in thread Pin
mikker_12312-Mar-07 19:43
mikker_12312-Mar-07 19:43 
AnswerRe: using nonstatic function in thread Pin
Russell Jones12-Mar-07 22:52
Russell Jones12-Mar-07 22:52 
QuestionHow do you change the scrollbar position of a WebBrowser control? [modified] Pin
ThisIsMyUserName212-Mar-07 17:55
ThisIsMyUserName212-Mar-07 17:55 
AnswerRe: How do you change the scrollbar position of a WebBrowser control? Pin
ThisIsMyUserName212-Mar-07 23:46
ThisIsMyUserName212-Mar-07 23:46 
QuestionDisplaying Custom Collection Control Contents Pin
andymo212-Mar-07 17:37
andymo212-Mar-07 17:37 
AnswerRe: Displaying Custom Collection Control Contents Pin
mike montagne12-Mar-07 20:33
mike montagne12-Mar-07 20:33 
GeneralRe: Displaying Custom Collection Control Contents Pin
andymo213-Mar-07 2:21
andymo213-Mar-07 2:21 
Thanks for the reply. I tried to keep it brief the first time Smile | :)

(I've changed the class names to avoid confusion w the word Image)

So my basic class is called Cover (as in album cover). For now, it is just a picturebox with a property that allows me to change the background colour.

I then have the collection Covers :

public class Covers : System.Collections.CollectionBase
{
    #region Indexer
    public Cover this[int index]
    {
        get
        {
            if (index < 0 || index > this.List.Count)throw new ArgumentOutOfRangeException();
            return (Cover)this.List[index];
        }
    }
    #endregion
    #region Adding methods
    public Covers Add(Color _colour)
    {
        Cover newCover = new Cover();
        newCover.BackColor = _colour;
        this.List.Add(newCover );
        return this;
    }
    #endregion
 }


And then finally there is the CoverView, which I would like to display the collection of Covers and eventually scroll through them. Originally I was trying this with a panel that I will move manually, but I just discovered the FlowObjectPanel so I am trying that:


public partial class CoverView : UserControl
{
    #region Members & Constructor
    private Covers vCovers;
    public CoverView()
    {
        InitializeComponent();
        SetStyle(ControlStyles.DoubleBuffer, true);
        this.vCovers = new Covers();
    }
    #endregion
    #region Properties
    [System.ComponentModel.Browsable(false)]
    public Covers Covers
    {
        get
        {
            return this.vCovers ;
        }
    }
    #endregion;
    protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
    {
        // this is just a test to see if I can get it to show the first object
        // I would normally put a loop here to cycle through the list if vCovers
        vCovers[0].Visible = true;
        vCovers[0].Parent = this;
        vCovers[0].Location = new Point(0, 0);
    }
}


I could do a direct paint, but I do want the Cover objects to be selectable so I may have to stick with this path for the moment. The list may get long tho, so I will give your suggestion some thought.

Anyhoo, I do not know how to get the Covers to show up in the CoverView control. Any help is appreciated ! Thank you !




Andy
GeneralRe: Displaying Custom Collection Control Contents Pin
mike montagne13-Mar-07 6:38
mike montagne13-Mar-07 6:38 
GeneralRe: Displaying Custom Collection Control Contents Pin
andymo214-Mar-07 10:41
andymo214-Mar-07 10:41 
GeneralRe: Displaying Custom Collection Control Contents Pin
mike montagne14-Mar-07 12:41
mike montagne14-Mar-07 12:41 
Questioncomputing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
icesha12-Mar-07 16:13
icesha12-Mar-07 16:13 
AnswerRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
rah_sin12-Mar-07 18:24
professionalrah_sin12-Mar-07 18:24 
GeneralRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
PS@Codeproj12-Mar-07 19:44
PS@Codeproj12-Mar-07 19:44 
GeneralRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
rah_sin12-Mar-07 20:06
professionalrah_sin12-Mar-07 20:06 
QuestionAnomalous behavior implementing the Dispose pattern? Pin
mike montagne12-Mar-07 15:49
mike montagne12-Mar-07 15:49 
QuestionQuestion on an error message Pin
JMOdom12-Mar-07 15:36
JMOdom12-Mar-07 15:36 
AnswerRe: Question on an error message Pin
rah_sin12-Mar-07 18:10
professionalrah_sin12-Mar-07 18:10 
QuestionCompressing files to multiple .zip's Pin
Ollie198612-Mar-07 13:16
Ollie198612-Mar-07 13:16 
AnswerRe: Compressing files to multiple .zip's Pin
Ollie198612-Mar-07 21:39
Ollie198612-Mar-07 21:39 
GeneralRe: Compressing files to multiple .zip's Pin
sherifffruitfly13-Mar-07 14:53
sherifffruitfly13-Mar-07 14:53 
QuestionHow to compare struct Pin
LiamD12-Mar-07 12:36
LiamD12-Mar-07 12:36 
AnswerRe: How to compare struct Pin
Dawid Mazuruk12-Mar-07 13:00
Dawid Mazuruk12-Mar-07 13:00 
AnswerRe: How to compare struct Pin
tgrt12-Mar-07 13:30
tgrt12-Mar-07 13:30 
AnswerRe: How to compare struct Pin
mike montagne12-Mar-07 14:22
mike montagne12-Mar-07 14:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.