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
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:pgilfeather
ID: 12277625
Im showing my clock in a textbox which is positioned by a table.
0
 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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