.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

convert property definition from vba to vb.net

0 REPLIES 0
Reply
Message 1 of 1
wang890
402 Views, 0 Replies

convert property definition from vba to vb.net

Public Property Let Filter(ByVal vData As String)
' Filters that the user can select in drowpdown combo
' Usage: Friendlyname1|*.ex1|Freindlyname2|*.ex2 etc.
' Default: "All Files (*.*)|*.*"

Dim pipepos As String

Do While InStr(vData, "|") > 0
  pipepos = InStr(vData, "|")

  If pipepos > 0 Then
    vData = Left$(vData, pipepos - 1) & vbNullChar & Right$(vData, Len(vData) - pipepos)
  End If

Loop

If Right$(vData, 2) <> vbNullChar & vbNullChar Then vData = vData & vbNullChar
If Right$(vData, 2) <> vbNullChar & vbNullChar Then vData = vData & vbNullChar

mvarFilter = vData
End Property

Public Property Get Filter() As String
Dim nullpos As String
Dim tempfilter As String

tempfilter = mvarFilter

Do While InStr(tempfilter, vbNullChar) > 0
  nullpos = InStr(tempfilter, vbNullChar)

  If nullpos > 0 Then
    tempfilter = Left$(tempfilter, nullpos - 1) & vbNullChar & Right$(tempfilter, Len(tempfilter) - nullpos)
  End If

Loop

If Right$(tempfilter, 1) = "|" Then tempfilter = Left$(tempfilter, Len(tempfilter) - 1)
If Right$(tempfilter, 1) = "|" Then tempfilter = Left$(tempfilter, Len(tempfilter) - 1)

Filter = tempfilter
End Property

  can someone help me convert this from vba to vb.net?

i figured out the simple ones like from:

 

Public Property Let FileTitle(ByVal vData As String)
' The name of the file without path
mvarFileTitle = vData
End Property

Public Property Get FileTitle() As String
FileTitle = mvarFileTitle
End Property

to this:

    Public Property FileTitle As String
        ' The name of the file without path
        Get
            Return mvarFileTitle
        End Get
        Set(ByVal value As String)
            mvarFileTitle = value
        End Set
    End Property

 thanks.

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost