【问题标题】:Draw listbox item properly vb.net 2005正确绘制列表框项目 vb.net 2005
【发布时间】:2011-04-14 13:08:56
【问题描述】:

我已经可以像这样在列表框 Drawitem 事件中正确绘制列表框项矩形

'// Draw border ACA899
e.Graphics.DrawRectangle(myPen, e.Bounds.X, e.Bounds.Y, e.Bounds.Width,e.Bounds.Height)

我怎么做

  1. 将项目文本定位在左中对齐?
  2. 更正未正确显示的矩形的 x2,y2(见图)末端?
  3. 指定绘制矩形的粗细?

谢谢

【问题讨论】:

  • DrawString 和 DrawRectangle 的文档在对齐、粗细和边界方面非常清楚 - 以及示例。你检查了吗?
  • 我用的是visual studio的express版,没有文档,在线版在哪里?

标签: .net winforms graphics listbox draw


【解决方案1】:

我自己找到了答案,感谢那些帮助过的人

'// Draw border ACA899
e.Graphics.DrawRectangle(myPen, e.Bounds.X, e.Bounds.Y, e.Bounds.Width-1,e.Bounds.Height)

【讨论】:

    猜你喜欢
    • 2016-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多