Pregunta

After searching for a few days, i thought maby someone can help me. I'm making a Windows form Application. And on one of my views i have a repeater with a label in there. This label is dynamicly sized. But My DataRepeater item won't adjust to the size of my label.

Has anyone a idea how to fix this?

The datarepeater i use is from the visual basic powerpacks. If any more Infromation is needed to help me, please let me know.

Regards Stephan

¿Fue útil?

Solución

It looks like DataRepeater is very limited with regards to resizing. I found this website that it looks like they got it working, but all of the items resize to the same size.

http://social.msdn.microsoft.com/forums/en-US/vbpowerpacks/thread/c93579f2-8b4c-4002-9ce2-152e2dddd10e/

Edit: This solution is a little bit more complex, but VERY flexible: You can use a FlowLayoutPanel:

You create an User Control for the item on the list and add a Select Property to the User Control. You add a list of the User Controls to the FlowLayoutPanel. When the User Control change size, it automatically adjust everything in the FlowLayoutPanel. (Disable WrapContents to prevent Horizontal Scrolling)

http://msdn.microsoft.com/en-us/library/ms171633.aspx

You can use the following in the UserControl to enable Click on the User Control to select it: Click event for .Net (Windows Forms) user control

In the form that use the FlowLayoutPanel, you add the Click event, and then apply the Select to only that one User Control.

You can use the SetBoundsControl inside the User Control to set the size of the item.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top