Solved

I want my textbox to move as I scroll down the page is this possible with vb.net?

Posted on 2004-10-11
8
234 Views
Last Modified: 2010-04-23
I want my textbox to move as I scroll down the page is this possible with vb.net?

If not could someone give me the code that does this?

Suppose I have textbox id=txt1 , I simply want it to either scroll as I scroll or appear not to move as I scroll. Either method will be appreciated.

Kind Regards

Paul G
0
Comment
Question by:pgilfeather
  • 4
  • 3
8 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12274716
web or winforms ?
0
 

Author Comment

by:pgilfeather
ID: 12274954
web
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 500 total points
ID: 12277472
Where Exactly are you showing your Clock?

<div id="divTopRight"    style="position:absolute">
--> In your HTML code Put your textbox that display Clock in here
</div>

After this </div> element Past following code
---------------------------------------------------------------------------------------------------------------------------------------
<script type="text/javascript">
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
{
     var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
     window[id + "_obj"] = el;
     if(d.layers)el.style=el;
     el.cx = el.sx = sx;el.cy = el.sy = sy;
     el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
     el.flt=function()
     {
          var pX, pY;
          pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
          document.documentElement && document.documentElement.clientWidth ?
          document.documentElement.clientWidth : document.body.clientWidth;
          pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
          document.documentElement.scrollTop : document.body.scrollTop;
          if(this.sy<0)
          pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
          document.documentElement.clientHeight : document.body.clientHeight;
          this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
          this.sP(this.cx, this.cy);
          setTimeout(this.id + "_obj.flt()", 40);
     }
     return el;
}
JSFX_FloatDiv("divTopRight",        -100,   10).flt();

</script>
---------------------------------------------------------------------------------------------------------------------------------------

-tushar
0
 

Author Comment

by:pgilfeather
ID: 12277625
Im showing my clock in a textbox which is positioned by a table.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 18

Expert Comment

by:tusharashah
ID: 12278233
Well then you need same thing for table also, just before table start <div> like following and after your </table> tag put a </div> tag!

----------------------------------------------------------------------
<div id="divTopRight"    style="position:absolute">
--> Your table
</div>
----------------------------------------------------------------------

-tushar
0
 

Author Comment

by:pgilfeather
ID: 12284900
id="divTopRight

Should this be the id of my textbox?

How does javascript know about my textbox?
0
 

Author Comment

by:pgilfeather
ID: 12285542
Thanks, your code worked excellently.

I've never used div tags before so I am well chuffed!

Cheers

Paul G
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12286089
Glad to know that :-)

Thanks for A!

-tushar
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now