Results 1 to 6 of 6

Thread: How to create Floating textbox?

  1. #1
    Join Date
    Jun 2011
    Posts
    77

    How to create Floating textbox?

    Please help me I want to have a floating text box. My main motive of this requirement is that I can scroll through the data and see to see the legends without any hesitations. I even tried freezing the panes, it did not help. I want Floating text box. What should I do? Any idea how to create it?

  2. #2
    Join Date
    May 2009
    Posts
    527

    re: How to create Floating textbox?

    To create a Floating text box add a TextBox from the Controls ToolBox and in the Worksheet_SelectionChange event add the following:


    Code:
    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
        With ActiveWindow.VisibleRange
            Me.TextBox1.Top = .Top
            Me.TextBox1.Left = .Left
        End With
    End Sub

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    re: How to create Floating textbox?

    Add the the following code to let your Floating box adjust properly.
    Code:
    If Me.Txt1.Left <> Abs(Me.CurrentSectionLeft) 
    Then Me.Txt1.Left = Abs(Me.CurrentSectionLeft) + 200
    And for comparing with the database the code will be:
    Code:
    Option Compare Database
    Option Explicit
    Dim BoxLeftIs As Long
    ---------------------------------------------------------
    
    Private Sub Form_Open(Cancel As Integer)
        BoxLeftIs = Me.Txt1.Left
    End Sub

  4. #4
    Join Date
    May 2009
    Posts
    539

    re: How to create Floating textbox?

    Here below is in advanced Vba for you. Take reference from it and apply that in your code.
    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    With ActiveWindow.VisibleRange
    ' subsitute the name of the Textbox in question
    TextBox1.Top = .Top + 5
    TextBox1.Left = .Left + .Width - TextBox1.Width - 45
    ' 45 seems to be the right number of points--use fewer if you've hidden the scrollbars or the row headings
    End With
    End Sub

  5. #5
    Join Date
    Apr 2009
    Posts
    569

    re: How to create Floating textbox?

    I have an advanced code for you. If you interested in mouse move on floating text then follow the below. It works since I have personally tried and experienced it.

    Code:
    onClipEvent(mouseMove) 
    {
    
        this._x = _root._xmouse;
    
        this._y = _root._ymouse;
    
        updateAfterEvent();
    
    }

  6. #6
    Join Date
    May 2009
    Posts
    637

    Re: How to create Floating textbox?

    To also add toll tip in your floating box then copy paste the below vba in your actual source to implent those.

    Code:
    on (rollOver) {
    
        _root.tooltip.msg = "the text you want to appear";
    
        _root.tooltip.gotoAndStop(2);
    
    }
    
    on (rollOut) { // hide it again
    
        _root.tooltip.gotoAndStop(1); 
    }

Similar Threads

  1. Max floating in the air bug in Max Payne 3
    By ronaldobrazil in forum Video Games
    Replies: 1
    Last Post: 01-06-2012, 06:59 PM
  2. floating point issue.Why is it so?
    By maria_megha in forum Software Development
    Replies: 1
    Last Post: 23-07-2011, 04:00 AM
  3. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  4. How to turn floating dock back on
    By Am_Wamika in forum Operating Systems
    Replies: 3
    Last Post: 30-07-2010, 01:11 PM
  5. How do I create a textbox in vb that lets you insert tabs?
    By Chandrakant81 in forum Software Development
    Replies: 3
    Last Post: 26-02-2009, 09:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,248,679.66782 seconds with 17 queries