I'm trying to use Windows API Code Pack to show up image and buttons in taskbar preview image. I have read a bunch of tutorials, but still I can't get this working.
Problem is that if I only set image, it shows fine, or if I just set buttons without image, they works. But not both simultaneously!
My code:
ThumbnailToolBarButton thumbButtonNext = new ThumbnailToolBarButton(this.Icon, "Next");
thumbButtonNext.Enabled = true;
thumbButtonNext.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(thumbButtonNext_Click);
ThumbnailToolBarButton thumbButtonPrev = new ThumbnailToolBarButton(this.Icon, "Prev");
thumbButtonPrev.Enabled = true;
thumbButtonPrev.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(thumbButtonPrev_Click);
TabbedThumbnail thumbImage = new TabbedThumbnail(this.Handle, pictureBox1.Handle);
thumbImage.Title = "Test title";
TaskbarManager.Instance.ThumbnailToolBars.AddButtons(this.Handle, thumbButtonPrev, thumbButtonNext);
TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(thumbImage);
With above code, I get pictureBox1
image, but not button controls:
If I leave out last row (which adds thumbnail image), then my two buttons show up, but of course not image (except the Windows default preview image of whole form):
Another thing, even if my image preview works, thumbImage.Title = "Test title"
does nothing, it does not change the title of preview image.
So what am I doing wrong?