Click here to Skip to main content
15,917,329 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Global.aspx Pin
Dave Kreskowiak3-Nov-06 6:52
mveDave Kreskowiak3-Nov-06 6:52 
QuestionHowTo display File Names + extension in a ListBox Pin
Zaegra3-Nov-06 4:32
Zaegra3-Nov-06 4:32 
AnswerRe: HowTo display File Names + extension in a ListBox Pin
Are Jay3-Nov-06 6:23
Are Jay3-Nov-06 6:23 
AnswerRe: HowTo display File Names + extension in a ListBox Pin
nlarson113-Nov-06 6:26
nlarson113-Nov-06 6:26 
GeneralRe: HowTo display File Names + extension in a ListBox Pin
Zaegra3-Nov-06 6:32
Zaegra3-Nov-06 6:32 
GeneralRe: HowTo display File Names + extension in a ListBox Pin
nlarson113-Nov-06 7:52
nlarson113-Nov-06 7:52 
Questionfunction to format partnumbers (alpha numeric) Pin
jds12073-Nov-06 2:54
jds12073-Nov-06 2:54 
AnswerRe: function to format partnumbers (alpha numeric) Pin
nlarson113-Nov-06 8:30
nlarson113-Nov-06 8:30 
Imports System.IO

Public Class Form2

Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MsgBox(FormatPartNumber("00-000", "3aA33A"))
End
End Sub

Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As String) As String
If IsNumeric(partnumber) Then Return CLng(partnumber).ToString(formatstyle)
If partnumber.Length < formatstyle.Length Then partnumber.PadLeft(formatstyle.Length, "0")

Dim sFormatted As String = String.Empty
Dim iFPos As Int16 = formatstyle.Length, iPPos As Int16 = partnumber.Length

Do While iFPos > 0
If Mid(formatstyle, iFPos, 1) = "0" Then
sFormatted = Mid(partnumber, iPPos, 1) & sFormatted
iPPos -= 1
iFPos -= 1
ElseIf Mid(formatstyle, iFPos, 1) = "-" Then
sFormatted = "-" & sFormatted
iFPos -= 1
End If
Loop

If iPPos > 0 Then
Do While iPPos > 0
sFormatted = Mid(partnumber, iPPos, 1) & sFormatted
iPPos -= 1
Loop
End If

Return sFormatted
End Function
End Class
GeneralRe: function to format partnumbers (alpha numeric) Pin
jds12073-Nov-06 9:00
jds12073-Nov-06 9:00 
GeneralRe: function to format partnumbers (alpha numeric) Pin
nlarson113-Nov-06 9:02
nlarson113-Nov-06 9:02 
GeneralRe: function to format partnumbers (alpha numeric) Pin
jds12073-Nov-06 9:25
jds12073-Nov-06 9:25 
GeneralRe: function to format partnumbers (alpha numeric) Pin
nlarson113-Nov-06 9:32
nlarson113-Nov-06 9:32 
QuestionHow to create a users manual Pin
rafaguilarsol3-Nov-06 1:56
rafaguilarsol3-Nov-06 1:56 
AnswerRe: How to create a users manual Pin
Dave Kreskowiak3-Nov-06 6:44
mveDave Kreskowiak3-Nov-06 6:44 
GeneralRe: How to create a users manual Pin
rafaguilarsol3-Nov-06 7:47
rafaguilarsol3-Nov-06 7:47 
QuestionSend image path to Crystal report8 through VB6 [modified] Pin
Kiran S. S.2-Nov-06 23:26
Kiran S. S.2-Nov-06 23:26 
QuestionHow to swap values in database with the help of combobox Pin
Khan.Bangash2-Nov-06 23:19
Khan.Bangash2-Nov-06 23:19 
AnswerRe: How to swap values in database with the help of combobox Pin
Akhilesh Yadav2-Nov-06 23:25
Akhilesh Yadav2-Nov-06 23:25 
AnswerRe: How to swap values in database with the help of combobox Pin
OldWarhorse3-Nov-06 3:09
OldWarhorse3-Nov-06 3:09 
Questionformat a time to 24 hours [modified] Pin
steve_rm2-Nov-06 22:19
steve_rm2-Nov-06 22:19 
AnswerRe: format a time to 24 hours Pin
Steven J Jowett2-Nov-06 22:30
Steven J Jowett2-Nov-06 22:30 
GeneralRe: format a time to 24 hours Pin
steve_rm2-Nov-06 23:22
steve_rm2-Nov-06 23:22 
QuestionSwaping Pin
Khan.Bangash2-Nov-06 22:00
Khan.Bangash2-Nov-06 22:00 
QuestionRe: Swaping Pin
Dave Sexton3-Nov-06 0:56
Dave Sexton3-Nov-06 0:56 
AnswerRe: Swaping Pin
OldWarhorse3-Nov-06 3:08
OldWarhorse3-Nov-06 3:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.