Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-07-2011
Member
 
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?
Reply With Quote
  #2  
Old 13-07-2011
Member
 
Join Date: May 2009
Posts: 523
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
Reply With Quote
  #3  
Old 13-07-2011
Member
 
Join Date: Apr 2009
Posts: 484
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
Reply With Quote
  #4  
Old 13-07-2011
Member
 
Join Date: May 2009
Posts: 532
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
Reply With Quote
  #5  
Old 13-07-2011
Member
 
Join Date: Apr 2009
Posts: 567
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();

}
Reply With Quote
  #6  
Old 15-07-2011
Member
 
Join Date: May 2009
Posts: 620
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); 
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create Floating textbox?"
Thread Thread Starter Forum Replies Last Post
Max floating in the air bug in Max Payne 3 ronaldobrazil Video Games 1 01-06-2012 06:59 PM
floating point issue.Why is it so? maria_megha Software Development 1 23-07-2011 04:00 AM
Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox Neil Ives Software Development 2 20-08-2010 01:23 AM
How to turn floating dock back on Am_Wamika Operating Systems 3 30-07-2010 01:11 PM
How do I create a textbox in vb that lets you insert tabs? Chandrakant81 Software Development 3 26-02-2009 09:59 PM


All times are GMT +5.5. The time now is 09:33 PM.