LabelControl in my form takes its Text property value dynamically.Text Value being long,half of the text gets overlapped by other controls or due to restriction in parent control size.I tried

AutoSize property

,but it autosizes only in one fixed direction,either vertical or horizontal.I have also tried

SetPreferedSize(New Size(50,50))

,but that is not working for me,can anybody show me a way how can I re-size my label-control to occupy a fixed rectangular size portion?

有帮助吗?

解决方案

You need to set following properties of Control:

WordWrap = Wrap

AutoSizeMode= None

VAlignment = Top

Width = 100

Height = 100

Or you can refer example link below:

Devexpress Example

其他提示

You can specify a maximum width/height for a auto-sized label:

Maximum width of 40px:

Me.Label1.MaximumSize = New Size(40, 0)

Maximum height of 40px:

Me.Label1.MaximumSize = New Size(0, 40)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top