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
233 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
Comment Utility
web or winforms ?
0
 

Author Comment

by:pgilfeather
Comment Utility
web
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 500 total points
Comment Utility
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
Comment Utility
Im showing my clock in a textbox which is positioned by a table.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 18

Expert Comment

by:tusharashah
Comment Utility
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
Comment Utility
id="divTopRight

Should this be the id of my textbox?

How does javascript know about my textbox?
0
 

Author Comment

by:pgilfeather
Comment Utility
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
Comment Utility
Glad to know that :-)

Thanks for A!

-tushar
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

11 Experts available now in Live!

Get 1:1 Help Now