1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with positioning InputBox form in Visual Basic

Discussion in 'Programming' started by nedim, Feb 25, 2010.

  1. #1
    Hi people,
    I have certain problem with positioning InputBox forum in Visual Basic.
    I would like to position this form in right-bottom corner of my screen, but I cannot achive this. I would like to do this dinamicly, so it fit by itself whatever screen resolution or size client has.

    The code I am using is quite simple:
    
    Public Sub inputNumber()
        Dim Number As Double
        On Error GoTo ErrorHandler
        Number = InputBox("Please insert Number", "NA", "", 0, 0)
        Select Case Number
        Case Is > 0
        MsgBox "Number is bigger then 0"
        Case Is < 0
        MsgBox "Number is smaller then 0"
        Case Else
        MsgBox "Number = 0"
        End Select
    ErrorHandler: MsgBox "You have not provided number"
    End Sub
    
    Code (markup):
    Now, the Input Box form is positioned at the left-top corner.
    Can anyone help me with this problem?
    Thanks in advance
     
    Last edited: Feb 25, 2010
    nedim, Feb 25, 2010 IP
  2. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to create your own form (probably border-less) with a text box and label and show it with SHOW_ON_TOP. In this way you have full control over the form. (For example you can verify the input from the user itself.)

    No need to waste time on trying to position less featured input box.

    How do you think?
     
    NeoCambell, Feb 25, 2010 IP
  3. WaQas

    WaQas Well-Known Member

    Messages:
    170
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    113
    #3
    try this

    
    Public Sub inputNumber()
        Dim Number As Double
        On Error GoTo ErrorHandler
        Number = InputBox("Please insert Number", "NA", "", Screen.Width - 6000, Screen.Height - 3000)
        Select Case Number
        Case Is > 0
        MsgBox "Number is bigger then 0"
        Case Is < 0
        MsgBox "Number is smaller then 0"
        Case Else
        MsgBox "Number = 0"
        End Select
    ErrorHandler: MsgBox "You have not provided number"
    End Sub
    
    Code (markup):
    or visit below url....

    http://www.vbforums.com/showthread.php?p=3738670
     
    WaQas, Feb 26, 2010 IP