用VB的一个updown控件和一个文本框实现:
windows任务栏上那个调整小时,分钟,秒的程序。大侠们应该明白我的意思的吧。(我问了2个月薪3500的深圳程序员,他们都说一下搞不定。不知道你们有没有什么好的办法)
分子不是问题,先谢谢大家了。

解决方案 »

  1.   

    Private Sub Form_Load()
    Text1.Text = Format(Time, "hh:mm:ss")
    End SubPrivate Sub UpDown1_DownClick()
    pos = Text1.SelStart
    lens = Text1.SelLength
    temp = Val(Text1.SelText)
    Text1.Text = Format(DateAdd(Switch(pos = 0, "h", pos = 3, "n", pos = 6, "s"), -1, Text1), "hh:mm:ss")
    Text1.SelStart = pos
    Text1.SelLength = lens
    End SubPrivate Sub UpDown1_UpClick()
    pos = Text1.SelStart
    lens = Text1.SelLength
    temp = Val(Text1.SelText)
    Text1.Text = Format(DateAdd(Switch(pos = 0, "h", pos = 3, "n", pos = 6, "s"), 1, Text1), "hh:mm:ss")
    Text1.SelStart = pos
    Text1.SelLength = lens
    End Sub
    这个源代码可以实现一部分功能, 但是离windows自带那个程序的功能还差得很远。
    大家参考一下这个程序,帮我想想。
    这个代码也是CSDN上的朋友告诉我的。
      

  2.   

    最简单的办法:
    “工程”-》“部件”,选中“Microsoft Windows Common Controls-2 6.0”。
    DTPicker控件可以解决楼主的问题,把DTPicker控件的UpDown属性设为True即可。
      

  3.   

    如果只是想调整小时,分钟,秒钟,需要把DTPicker控件的Format属性设为dtpTime
      

  4.   

    Private Type SYSTEMTIME
        wYear As Integer
        wMonth As Integer
        wDayOfWeek As Integer
        wDay As Integer
        wHour As Integer
        wMinute As Integer
        wSecond As Integer
        wMilliseconds As Integer
    End Type
    Private Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
    Private Sub Form_Load()
        'KPD-Team 2000
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim lpSystemTime As SYSTEMTIME
        lpSystemTime.wYear = 2000
        lpSystemTime.wMonth = 1
        lpSystemTime.wDayOfWeek = -1
        lpSystemTime.wDay = 24
        lpSystemTime.wHour = 23
        lpSystemTime.wMinute = 26
        lpSystemTime.wSecond = 0
        lpSystemTime.wMilliseconds = 0
        'set the new time
        SetSystemTime lpSystemTime
    End Sub
      

  5.   

    楼上五个星的大哥, 误会我的意思了。
    我的意思是说双击任务栏上显示的那个时间, 会弹出一个对话框,那里有一个updown按钮和一个文本框,点击updown按钮,可以调整小时分钟钞钟,我想用vb的updown控件和一个文本框控件来模拟
    这个功能。现在我应该是说清楚了吧。 呵呵
      

  6.   

    ALL RIGHT:Private Sub Form_Load()
    DTPicker1.UpDown = True
    DTPicker1.Format = dtpTime
    DTPicker1.Value = Time
    End Sub
      

  7.   

    用picturebox 做容器,里面放三个textbox两个label