Notifications
Clear all

[Closed] Thumbnail viewer control

No problem :). The internet is always tricky when decoding messages.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0
 i never encode my messages or encrypt my code

and a cute girl is better than beautiful …IMHO

Sweet updates, works great

So I haven’t tried yet… but I’m assuming there is still not support for .tga files and whatnot? You have to load in actual files correct, and not bitmaps?

I also can’t seem to get thumbItem.showExitButton false to work.

It still shows the x in the corner for the thumbs on creating the rollout… I’m setting this command before adding them to the array.

Thanks!

Hi Jason,
I generally use methods for things that do something and properties for changing physical attributes on the control. You’ve kind of already done the work, It would be really easy to consolidate your two methods into a property. For example,

    public void setBackColor2(Color myColor)
        {
            thumbContainer.Panel2.BackColor = myColor;
            thumbLabelBackColor = myColor;
        }

        // Get the 2nd panel's backColor
        public Color getBackColor2()
        {
            return thumbLabelBackColor;
        }

could be declared like this –

-- store a private variable of the color
private Color _BackColor2 ;

public Color BackColor2 {
	get { return _BackColor2; }
	set { _BackColor2 = value; 
               thumbContainer.Panel2.BackColor = value;
              }
}

You declare a private variable to hold the color, this is what the property setter writes to, and what it retrieves when asked. I use the underscore on the private member variable so that it is obvious that there is a link between this and the property name. I think this is a pretty common way of writing this.

You can put what you like in the set part of the property. this example should now be automatically bound to the panel2 on the control. Apologies if there are any syntax typos, I write in VB but it’s pretty much identical. I hope you get the idea. Properties that are read-only will just have the get part, without the set.

So the way you have done it is exactly like a property, except split into two methods!

Thanks Pete, that’s exactly what I was looking for!

Hi Matthew, that’s right, there isn’t any support for .tga files. Mind if you PM me some code to check out what’s wrong :)? You could also try the method ‘.showItemsExitButton false’ on the main thumbnail viewer control in the meantime.

 lo1

Just wanted to say a huge thanks to Jason for writing this control, I’m really loving it!

 lo1

And as long as we’re making requests, I’d like to request the following:

  1. An option to disable multi-selection.
  2. Control over the spacing between the thumbnail items and the size of the padding on each items.

Thanks lo! I’ll try to get to those requests soon.

Page 5 / 5