Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved Visual Basic
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rylogy
    wrote on last edited by
    #1

    [Message Deleted]

    P G 2 Replies Last reply
    0
    • R Rylogy

      [Message Deleted]

      P Offline
      P Offline
      paulajohn
      wrote on last edited by
      #2

      Hi there, If you add the calendar control into the form, and from there, you can tell if that is a leap year or not. I may be wrong but I think the calendar control class will return some boolean that states wherether select year is a leap year such as Messagebox.show(ctrCalendar.selectedate.Isleapyear) Good luck

      R 1 Reply Last reply
      0
      • P paulajohn

        Hi there, If you add the calendar control into the form, and from there, you can tell if that is a leap year or not. I may be wrong but I think the calendar control class will return some boolean that states wherether select year is a leap year such as Messagebox.show(ctrCalendar.selectedate.Isleapyear) Good luck

        R Offline
        R Offline
        Rylogy
        wrote on last edited by
        #3

        that will work fine, I forgot to specify that I need to do that with my own codes, only using if, else if in the code and textbox for input and another textbox for output and a button. Thanks for your help though

        1 Reply Last reply
        0
        • R Rylogy

          [Message Deleted]

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          You can use the modulo operator to find out if a number is divisible by another. The expression x mod y returns zero if x is divisible by y. That should be enough to get you started. :)

          --- b { font-weight: normal; }

          R 1 Reply Last reply
          0
          • G Guffa

            You can use the modulo operator to find out if a number is divisible by another. The expression x mod y returns zero if x is divisible by y. That should be enough to get you started. :)

            --- b { font-weight: normal; }

            R Offline
            R Offline
            Rylogy
            wrote on last edited by
            #5

            I have something but it's not quite right, because years ending with 00 before de decimal are not leap years (example 1700 1800 1900 or even 2000000 as long as it has 00) I don't know how to do that. Also thanks for your help Guffa. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As Integer y = TextBox1.Text If y Mod 4 = 0 Then TextBox2.Text = "is leap" ElseIf y Mod 400 = 0 Then TextBox2.Text = "is leap" Else TextBox2.Text = "isn't leap" End If End Sub

            R 1 Reply Last reply
            0
            • R Rylogy

              I have something but it's not quite right, because years ending with 00 before de decimal are not leap years (example 1700 1800 1900 or even 2000000 as long as it has 00) I don't know how to do that. Also thanks for your help Guffa. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As Integer y = TextBox1.Text If y Mod 4 = 0 Then TextBox2.Text = "is leap" ElseIf y Mod 400 = 0 Then TextBox2.Text = "is leap" Else TextBox2.Text = "isn't leap" End If End Sub

              R Offline
              R Offline
              Rylogy
              wrote on last edited by
              #6

              Nevermind I got it :-D

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups