2 Replies - 408 Views - Last Post: 25 January 2013 - 07:32 PM Rate Topic: -----

#1 Brilene  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 25-January 13

Month Date

Posted 25 January 2013 - 04:45 PM

This code puts the date into an array of text boxes and moves it down one box when the month date changes.

  MonthPart = Month(Date)
  For i = 0 To 11
  Monlbl(i).Caption = UCase(MonthName((13 + i - MonthPart) Mod 12 + 1, True))
  Next i

  For i = 0 To 1
  Monlbl(12).Caption = Format(Date, "yyyy")
  Next i


This code works perfect in vb6 but i can't work it out in vb.net

This post has been edited by AdamSpeight2008: 25 January 2013 - 04:56 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Month Date

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3724
  • View blog
  • Posts: 12,990
  • Joined: 12-December 12

Re: Month Date

Posted 25 January 2013 - 05:04 PM

I assume Monlbl is a VB6 control array? VB.NET doesn't have control arrays and you would need to replicate their behaviour, using a collection of some kind.

http://stackoverflow...rrays-in-vb-net

http://www.dreaminco...-control-array/

I suppose you might cheat and name the textboxes "Something1", "Something2" and use string processing to loop through them, but this is a very messy approach.

Actually, I think you might be using labels, whose Caption property is now their Text property.

This post has been edited by andrewsw: 25 January 2013 - 05:03 PM

Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1606
  • View blog
  • Posts: 5,163
  • Joined: 25-September 09

Re: Month Date

Posted 25 January 2013 - 07:32 PM

here's a tutorial of producing an array of a controls which might help in your task

Oops, nevermind, didn't see the link in andrewsw's post.

This post has been edited by CharlieMay: 25 January 2013 - 07:34 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1