以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助] [求助] 时间条显示问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=80513) |
||||
-- 作者:317617216 -- 发布时间:2016/1/25 11:07:00 -- [求助] [求助] 时间条显示问题 如题如下文,请教各位大侠老师们,谢谢!!!
【图1的代码如下】: 【窗口事件→AfterLoad】 Dim lbl As WinForm.Label lbl = e.Form.Controls("Label7") Dim ln As New Lunar(Date.Today) Dim s As String = ln.LunarDate Dim v() As String = s.Split("-") Dim r As String = CLNum(v(2)) Dim r2 As String = IIF(r.length=2,r.Insert(1,"十"),r) Dim r1 As String =IIF(r2.EndsWith("零"),r2.Replace("零",""),r2) If r1.length=1 Then s = " 【北京时间】:" & CLDate(Date.Today) & " "& Format(Date.Today,"dddd") & " " &"【农历】:" & CLNum(v(0)) & "年" & CLNum(v(1)) & "月" & IIF(r1.length=1,r1.Insert(0,"初"),r1) lbl.Text = s.Replace("零","O") & " 竭诚为您服务 ! " Else s = " 【北京时间】:" & CLDate(Date.Today) & " "& Format(Date.Today,"dddd") & " " &"【农历】:" & CLNum(v(0)) & "年" & CLNum(v(1)) & "月" & IIF(r2.EndsWith("零"),r2.Replace("零",""),r2) & "日" lbl.Text = s.Replace("零","O") & " 竭诚为您服务 ! " End If
【窗口事件→TimerTick】 Dim t As Date = Date.Now e.Form.Controls("Label8").text = Format(t, "T") ---------------------------------------------------分--------割---------线--------------------------------------------------
【图2代码如下】: 【窗口事件→AfterLoad】 Dim lbl As WinForm.Label lbl = e.Form.Controls("Label7") Dim ln As New Lunar(Date.Today) Dim s As String = ln.LunarDate Dim v() As String = s.Split("-") Dim r As String = CLNum(v(2)) Dim r2 As String = IIF(r.length=2,r.Insert(1,"十"),r) Dim r1 As String =IIF(r2.EndsWith("零"),r2.Replace("零",""),r2) If r1.length=1 Then s = " 【北京时间】:" & CLDate(Date.Today) & " "& Format(Date.Today,"dddd") & " "& Format(DateTime.Today,"F") & " " &"【农历】:" & CLNum(v(0)) & "年" & CLNum(v(1)) & "月" & IIF(r1.length=1,r1.Insert(0,"初"),r1) lbl.Text = s.Replace("零","O") & " 竭诚为您服务 ! " Else s = " 【北京时间】:" & CLDate(Date.Today) & " "& Format(Date.Today,"dddd") & " "& Format(DateTime.Today,"F") & " " &"【农历】:" & CLNum(v(0)) & "年" & CLNum(v(1)) & "月" & IIF(r2.EndsWith("零"),r2.Replace("零",""),r2) & "日" lbl.Text = s.Replace("零","O") & " 竭诚为您服务 ! " End If
[此贴子已经被作者于2016/1/25 11:56:58编辑过]
|
||||
-- 作者:317617216 -- 发布时间:2016/1/25 11:08:00 --
|
||||
-- 作者:Hyphen -- 发布时间:2016/1/25 11:59:00 -- 把label控件移动到合适的位置并置顶 |
||||
-- 作者:317617216 -- 发布时间:2016/1/25 12:04:00 -- 以下是引用Hyphen在2016/1/25 11:59:00的发言:
把label控件移动到合适的位置并置顶 谢谢,原本想在一个代码中显示的,开始也是移动到相应位置,但有时会被遮蔽的现象,
|
||||
-- 作者:Hyphen -- 发布时间:2016/1/25 12:06:00 -- 置顶就不会被 遮蔽。或者把内容分成3个label显示 |
||||
-- 作者:317617216 -- 发布时间:2016/1/25 12:21:00 -- 谢谢 |