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
239 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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