Results 1 to 6 of 6

Thread: VB namespace to use or not to use ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    79

    Question VB namespace to use or not to use ?

    I am confused whether I should use any functions provided by microsoft.visualbasic namespace. This issue came about as I needed to check the ASCII character of the key pressed and used chr() function, this is a visualbasic namespace function and I noted also a line Microsoft.VisualBasic in the imports section.

    My aim is that to make sure that

    1. I do not use any VB.dll files.
    2. Installation requires only the net framework
    3. xcopy installations will be possible.
    4. Do not have any incompatibility issues in the future.


    Is it possible and is it advisable to not use any function which is microsoft.visualbasic name space.


    Thanks

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Its possible, its up to you whether or not to use it. I don't use it myself.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Also a note using the VB namespace you can still accomplish 1-3, only 4 is questionable and it is possible that there will be no future problems (unless you plan to use Mono later).

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Posts
    79
    What will be the replacement for chr(). What will be the coding for something similar to the following:-

    Private Sub txtConfPW_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtConfPW.KeyPress
    If e.KeyChar = Chr(13) Or e.KeyChar = Chr(27) Then
    Me.Close()
    End If
    End Sub

    This is part of password confirmation screen where I want to cloase the screen if 'Enter' or 'Esc' is pressed.

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ctype(13, char)
    \m/\m/

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If you don't want to use Char function , do this :

    VB Code:
    1. If Asc(e.KeyChar()) = 13 Or Asc(e.KeyChar()) = 27 Then
    2.             Me.Close()
    3. End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width