CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Visual 'Basic' help needed!

  1. #1
    Join Date
    Sep 2002
    Location
    Australlia
    Posts
    1

    Exclamation Visual 'Basic' help needed!

    Hello... i am in need of some code for the program i am trying to write. I am new at this, so please bare with me

    I am writing a simple program that allows the user to click on update time and Date and thus display both those things in a Text box. That i can do. What i cant seem to remember the code for, is the bit where the user selects a radio button called 24hr, then the user hits the update time/date button, and hey presto the time turns to 24hr time. Could someone please get back to me in regards to this?

    thanks

    Kate

  2. #2
    Join Date
    Apr 2000
    Location
    Southampton, UK
    Posts
    329
    Code:
    Private Sub Command1_Click()
        SetTimeFormat IIf(optTimeFormat(0).Value, "Medium Time", "Long Time")
    End Sub
    
    Private Sub optTimeFormat_Click(Index As Integer)
        SetTimeFormat IIf(Index, "Long Time", "Medium Time")
    End Sub
    
    Private Sub SetTimeFormat(ByVal TimeFormat As String)
        Text1.Text = Format(Now(), "dddd, dd mmmm, yyyy ") & Format(Now(), TimeFormat)
    End Sub
    This requires a comand button, two option buttons as an array called optTimeFormat (one of which should have the .Value property set to True) and a text box.
    TimCottee
    I know a little about a lot of things and a lot about very little.

    Brainbench MVP For Visual Basic
    http://www.brainbench.com

    MCP, MCSD, MCDBA, CPIM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)