C++/CLI @ runtime add a PictureBox to a tab control, I need to do this at run-time because they're to represent some data the user must be able to manipulate. I actually need them to be in some kind of scrollable panel on the tabcontrol. Any ideas?

Recommended Answers

All 4 Replies

Declare a picture box, set it's coordinates and background image (and the background image layout). Once that's all done, use the .Add() method of the tab control to place it on the form (I think the default is visible, so you don't have to set that before adding it). See if that works, otherwise I'll put together an example to refresh my memory.

I appreciate the response, but I need to wait until tomorrow to give it a try--which I will, and I'll post the result.

LOL okay. I'll give it a test if I have a chance.

You have to add it to the tabPage of the tabControl directly. I hid the PB until I repositioned it to where it belongs. Other than that, what I replied with before should do the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.