To create a number of letters we often use roman numerals to indicate the month of making the letter.For example, the letter number is '001 / Int/III/2010' where the symbol 'III' indicates that the letter was made in March 2010.
For this we need a function that can convert an integer number from 1 to 12 into roman numerals. In the Visual Basic programming, we can easily create such a function. Well, here we'll show an example program to create such functions, as well as examples of how to use it.
Function IToR(i As Integer) As String Dim s As String s = "I II III IV V VI VII VIIIIX X XI XII " IToR = Mid(s, (i - 1) * 4 + 1, 4) End Function
So your Screen design will look like the image below:
Private Sub cmdConvert_Click() txtRomNum.Text = IToR(Val(txtMonth.Text)) End Sub
Okay, you have completed the program
Now it's time to test
- Run your program
Consider the results
1 comments:
Very useful tips. Can you post programming tips with VB6 to print document or data to a printer?
Thanks for your sharing.
Post a Comment