状态栏的简单问题

yinzs 2008-12-21 04:51:41
想在窗口的状态栏设置两种文本:

当前用户名,左对齐;
当前日期时间,右对齐;


现在就加了一个StatusBar1控件

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
strTime = Now
StatusBar1.Text = "当前用户:" + strUser + "当前时间:" + strTime
End Sub


正确的应该怎么做?
...全文
52 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
forever_zw 2008-12-22
  • 打赏
  • 举报
回复
同上
sunxinyu 2008-12-21
  • 打赏
  • 举报
回复
顶2楼
yanlongwuhui 2008-12-21
  • 打赏
  • 举报
回复
参考如下:
With StatusBar1
.Panels.Add("当前用户:" + struser)
.Panels.Add("当前时间:" + strTime.ToString)
.Panels(0).Alignment = HorizontalAlignment.Left
.Panels(1).Alignment = HorizontalAlignment.Right
.Panels(1).AutoSize = StatusBarPanelAutoSize.Spring
End With
北京的雾霾天 2008-12-21
  • 打赏
  • 举报
回复
应该在StatusBar中添加子StatusBarPanel,只用Text应该不行。

16,553

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧