Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: date and time present

  1. #1
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question date and time present

    Hello,

    I am making a bank program right now, i just have a few questions, this is regarding to the features of C#, first, i know to make a date and time and how to display which i put datetime date; and i made a list box to show either depost, withdraw, how much, and the date and time in the list box, my first question is how do i get it to be present time, every time i deposit or withdraw it shows 1/1/0001, i want it to show present, the second question is i made an additonal form which would be the transfer button, my question is, when you call up to form.show for say... and you dont want the user to go back to the other form and hit the button again, making it display two of the same forms, is there a way i can have the user only stay at the transfer form and not go back until he hits close on the transfer form? (hope that made sense) the last question is how do i embed an icon on the form? when i mean icon i mean the top left hand corner of the program? I probably will have additional questions but one last thing, is there anything i can do with my bank program like nice little features add on to it that you have done in the past with your projects? it would be helpful for me to learn. Thank you in advance.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question Re: date and time present

    I have thought of another question pertaining to the bank program, when i try and press the button 1 on my keyboard, i wanted it to also show up on the screen, and not have to click on button 1, how do i do that? (hope i explained that)

  4. #3
    gaylo565's Avatar
    gaylo565 is offline Programming Professional
    Join Date
    May 2007
    Location
    flagstaff, az
    Posts
    268
    Rep Power
    21

    Re: date and time present

    While there are several ways to get the current date I'm only gonna list one:
    Code:
    DateTime dtToday = DateTime.Now;
    Make sure you set your variable to the correct time before you print it to a record (before meaning it runs the code first.)
    To hide your old form there should me a hide method...try this.Hide() just before you open your new form. The icon should be as easy as modifying a button or label until you come up with what you want the writing a click handler event to the icon. Under the method for the click handler have it call whichever file or function you want your icon to access. It sounds like you have a good solid project going there Maybe try adding some card access to accounts. For example; if someone enters a card number (you would use the input from a card reader in real life but not all of us have one of those lying around) and then give them access to their account or other options concerning ordering new cards, reporting cards stolen, and other such things. Good luck and happy coding!

  5. #4
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question Re: date and time present

    thanks gaylo again,

    I have tried to use the this.hide() however the problem with that is if i use it, and close the program complete, it does not necessary close it out because i tried running it, closing the transfer form to go back to original form, which i just used this.close to close the transfer form and then did form1.show, and when i close the form1, it still things the program is running, which i am assuming the first form1 is still running, does that make sense, is there another way besides hidding the form, maybe making it none accessible if you try to click it just makes a sound and you can only click on the form2 which is the transfer form. does that make sense? and for the card key... that will have to wait, sounds a little advance which i would be happy to learn, but for now the only thing i do have right now is just launching the program, maybe later i will create another project that includes this one, but the user will have to enter username and password, checking on the SQL database/Access database, verifying and allow them to come in and bring up there account checking and savings... or what else can you add to it?

  6. #5
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: date and time present

    Hello,

    Also i want to add, like banks, they have transaction numbers, how would i go about adding that to the list box, like starting from 1-whatever down the line for every transaction that is done to the account (i happen to call my class account that holds the variable balance, which includes the depost and withdraw method for FYI)?

  7. #6
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: date and time present

    Quote Originally Posted by Siten0308 View Post
    thanks gaylo again,

    I have tried to use the this.hide() however the problem with that is if i use it, and close the program complete, it does not necessary close it out because i tried running it, closing the transfer form to go back to original form, which i just used this.close to close the transfer form and then did form1.show, and when i close the form1, it still things the program is running, which i am assuming the first form1 is still running, does that make sense, is there another way besides hidding the form, maybe making it none accessible if you try to click it just makes a sound and you can only click on the form2 which is the transfer form. does that make sense? and for the card key... that will have to wait, sounds a little advance which i would be happy to learn, but for now the only thing i do have right now is just launching the program, maybe later i will create another project that includes this one, but the user will have to enter username and password, checking on the SQL database/Access database, verifying and allow them to come in and bring up there account checking and savings... or what else can you add to it?
    Launch the subform with ShowDialog() instead of Show(). This will make it modal, which is what you want I believe.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  8. #7
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Unhappy Re: date and time present

    Yup thats it Xav thanks, but now i am wondering about my other questions.

    1.when i try and press the button 1 on my keyboard, i wanted it to also show up on the screen, and not have to click on button 1, how do i do that? (hope i explained that)

    2.Embed a Icon which Gaylo went over but still need more info on that if anyone can provide it.

    3. problem with current time datetime date = new datetime.Now(), it seems to work but for some reason it only stay to the most recent, even after more than 5 minutes of trying it still stays with the first time such as

    10/8/2008 2:49pm
    then wait 5 minutes and make a deposit, it still says:
    10/8/2008 2:49pm
    What gives : (

  9. #8
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: date and time present

    You need to use a timer to constantly update the date. The line of code puts the current date into a variable - it's not automatically going to increment itself, you have to do that.

    Also, you can send keys to the program or just edit a control's Text property if that's what you want.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  10. #9
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question Re: date and time present

    Hello Xav,

    thanks for the info, i got the keyboard keys down now, the timer if you can go into more detail on that by incrementing the datetime.now?

    and also embed an icon on the top left hand corner of the program, i know VCE or VS 2008 makes it easy for you, but i try that why and nothing but errors comes up such as "argument, picture must be used as an icon" but i the file extension is .ico and the size is 32X32 and tried 21X21 but still error, i am trying to figure out how to embed it using code which might work out better than the VCE/VS tool.

  11. #10
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: date and time present

    Did it use to be a normal picture that you just changed the extension of to ".ico"?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. plus 9 hours to date/time php
    By the jil in forum PHP Development
    Replies: 3
    Last Post: 05-06-2010, 12:09 AM
  2. C# date time picker
    By BAHAR in forum C# Programming
    Replies: 2
    Last Post: 07-29-2009, 10:11 AM
  3. PHP date? Time?
    By phpforfun in forum PHP Development
    Replies: 6
    Last Post: 03-19-2009, 04:13 PM
  4. Date and Time
    By zeroradius in forum Database & Database Programming
    Replies: 2
    Last Post: 02-01-2009, 12:21 PM
  5. Time/Date Calculations
    By dcs in forum C Tutorials
    Replies: 0
    Last Post: 10-19-2008, 10:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

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