Search Results

Search found 8232 results on 330 pages for 'position'.

Page 3/330 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C# - Moving a control to the mouse's position

    - by APShredder
    Hello everybody. I am trying to get a control to follow the cursor when the user clicks and drag the control. The problem is that 1.) the control doesn't go to the mouse's position, and 2.) the control flickers and flies all over the place. I've tried a few different methods of doing this, but all so far have failed. I've tried: protected override void OnMouseDown(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } and protected override void OnMouseMove(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } but neither of these work. Any help is appreciated, and thanks in advance!

    Read the article

  • Setting the Cursor Position in a Win32 Console Application

    - by Jim Fell
    How can I set the cursor position in a Win32 Console application? Preferably, I would like to avoid making a handle and using the Windows Console Functions. (I spent all morning running down that dark alley; it creates more problems than it solves.) I seem to recall doing this relatively simply when I was in college using stdio, but I can't find any examples of how to do it now. Any thoughts or suggestions would be greatly appreciated. Thanks.

    Read the article

  • How to move a kinect skeleton to another position

    - by Ewerton
    I am working on a extension method to move one skeleton to a desired position in the kinect field os view. My code receives a skeleton to be moved and the destiny position, i calculate the distance between the received skeleton hip center and the destiny position to find how much to move, then a iterate in the joint applying this factor. My code, actualy looks like this. public static Skeleton MoveTo(this Skeleton skToBeMoved, Vector4 destiny) { Joint newJoint = new Joint(); ///Based on the HipCenter (i dont know if it is reliable, seems it is.) float howMuchMoveToX = Math.Abs(skToBeMoved.Joints[JointType.HipCenter].Position.X - destiny.X); float howMuchMoveToY = Math.Abs(skToBeMoved.Joints[JointType.HipCenter].Position.Y - destiny.Y); float howMuchMoveToZ = Math.Abs(skToBeMoved.Joints[JointType.HipCenter].Position.Z - destiny.Z); float howMuchToMultiply = 1; // Iterate in the 20 Joints foreach (JointType item in Enum.GetValues(typeof(JointType))) { newJoint = skToBeMoved.Joints[item]; // This adjust, try to keeps the skToBeMoved in the desired position if (newJoint.Position.X < 0) howMuchToMultiply = 1; // if the point is in a negative position, carry it to a "more positive" position else howMuchToMultiply = -1; // if the point is in a positive position, carry it to a "more negative" position // applying the new values to the joint SkeletonPoint pos = new SkeletonPoint() { X = newJoint.Position.X + (howMuchMoveToX * howMuchToMultiply), Y = newJoint.Position.Y, // * (float)whatToMultiplyY, Z = newJoint.Position.Z, // * (float)whatToMultiplyZ }; newJoint.Position = pos; skToBeMoved.Joints[item] = newJoint; //if (skToBeMoved.Joints[JointType.HipCenter].Position.X < 0) //{ // if (item == JointType.HandLeft) // { // if (skToBeMoved.Joints[item].Position.X > 0) // { // } // } //} } return skToBeMoved; } Actualy, only X position is considered. Now, THE PROBLEM: If i stand in a negative position, and move my hand to a positive position, a have a strange behavior, look this image To reproduce this behaviour you could use this code using (SkeletonFrame frame = e.OpenSkeletonFrame()) { if (frame == null) return new Skeleton(); if (skeletons == null || skeletons.Length != frame.SkeletonArrayLength) { skeletons = new Skeleton[frame.SkeletonArrayLength]; } frame.CopySkeletonDataTo(skeletons); Skeleton skeletonToTest = skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault(); Vector4 newPosition = new Vector4(); newPosition.X = -0.03412333f; newPosition.Y = 0.0407479f; newPosition.Z = 1.927342f; newPosition.W = 0; // ignored skeletonToTest.MoveTo(newPosition); } I know, this is simple math, but i cant figure it out why this is happen. Any help will be apreciated.

    Read the article

  • CSS and position little problem

    - by Azzyh
    hello so i have a content box and this menu box.. now the menu box moves when you have the browser in normal fullsize, and if you change size of the browser... here is picture: What do i do wrong? Here is my code: #menu { position: absolute; background: #FFF; text-decoration: none; border: 1px solid #000; color: #000; padding-left: 14px; padding-right: 14px; margin: 12px; } #content { margin: auto; width: 800px; border: 1px solid #000; padding: 10px; }

    Read the article

  • Javascript game with css position

    - by newb125505
    I am trying to make a very simple helicopter game in javascript and I'm currently using css positions to move the objects. but I wanted to know if there was a better/other method for moving objects (divs) when a user is pressing a button here's a code i've got so far.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Game 2 helicopter</title> <script type="text/javascript"> function num(x){ return parseInt(x.replace(/([^0-9]+)/g,'')); } function getPos(x, y){ var inum=Math.floor(Math.random()*(y+1-x)) + x; inum=inum; return inum; } function setTop(x,y){ x.style.top = y+'px'; } function setBot(x,y){ x.style.bottom = y+'px'; } function setLeft(x,y){ x.style.left = y+'px'; } function setRight(x,y){ x.style.right = y+'px'; } function getTop(x){ return num(x.style.top); } function getBot(x){ return num(x.style.bottom); } function getLeft(x){ return num(x.style.left); } function getRight(x){ return num(x.style.right); } function moveLeft(x,y){ var heli = document.getElementById('heli'); var obj = document.getElementById('obj'); var poss = [20,120,350,400]; var r_pos = getPos(1,4); var rand_pos = poss[r_pos]; xleft = getLeft(x)-y; if(xleft>0){ xleft=xleft; } else{ xleft=800; setTop(x,rand_pos); } setLeft(x,xleft); setTimeout(function(){moveLeft(x,y)},10); checkGame(heli,obj); } var heli; var obj; function checkGame(x,y){ var obj_right = getLeft(x) + 100; var yt = getTop(y); var yb = (getTop(y)+100); if(getTop(x) >= yt && getTop(x) <= yb && obj_right==getLeft(y)){ endGame(); } } function func(){ var x = document.getElementById('heli'); var y = document.getElementById('obj'); alert(getTop(x)+' '+getTop(y)+' '+(getTop(y)+200)); } function startGame(e){ document.getElementById('park').style.display='block'; document.getElementById('newgame').style.display='none'; heli = document.getElementById('heli'); obj = document.getElementById('obj'); hp = heli.style.top; op = obj.style.top; setTop(heli,20); setLeft(heli,20); setLeft(obj,800); setTop(obj,20); moveLeft(obj,5); } function newGameLoad(){ document.getElementById('park').style.display='none'; document.getElementById('newgame').style.display='block'; } function gamePos(e){ heli = document.getElementById('heli'); obj = document.getElementById('obj'); var keynum; var keychar; var numcheck; if(window.event){ // IE keynum = e.keyCode; } else if(e.which){ // Netscape/Firefox/Opera keynum = e.which; } keychar = String.fromCharCode(keynum); // up=38 down=40 left=37 right=39 /*if(keynum==37){ //left tl=tl-20; db.style.left = tl + 'px'; } if(keynum==39){ //right //stopPos(); tl=tl+20; db.style.left = tl + 'px'; }*/ curb = getTop(heli); if(keynum==38){ //top setTop(heli,curb-10); //alert(curb+10); } if(keynum==40){ //bottom setTop(heli,curb+10); //alert(curb-10); } } function endGame(){ clearTimeout(); newGameLoad(); } </script> <style type="text/css"> .play{position:absolute;color:#fff;} #heli{background:url(http://classroomclipart.com/images/gallery/Clipart/Transportation/Helicopter/TN_00-helicopter2.jpg);width:150px;height:59px;} #obj{background:red;width:20px;height:200px;} .park{height:550px;border:5px solid brown;border-left:none;border-right:none;} #newgame{display:none;} </style> </head> <body onload="startGame();" onkeydown="gamePos(event);"> <div class="park" id="park"> <div id="heli" class="play"></div> <div id="obj" class="play"></div> </div> <input type="button" id="newgame" style="position:absolute;top:25%;left:25%;" onclick="startGame();" value="New Game" /> </body> </html>

    Read the article

  • css position question: layers with z-index?

    - by user239831
    hey guys, i have a probably rather simpel problem: my website has two layers: 1) a drag&drop navigation on top which should be positioned absolute, so scrolling doesn't affect the bars. 2) a content area in the back behind the navigation which should be scrollable. you can see what i mean right here: http://jsfiddle.net/Pghqv/ however now, i cannot click links in my content-area in the back. any ideas or solutions how i can still have the same position result and the links in the back are working? thank you very much.

    Read the article

  • AJAX Autocomplete appears at a random vertical position, not touching the textbox

    - by Tim
    Hi, I am using the AJAX Autocomplete extender for ASP.NET 2. Everything works fine...I am calling a webservice which gets me the values to fill the drop down with after 3 letters are typed into certain es. I have set the maxheight attribute and am using a scrollbar in case there are more entries than would fit that height. However, I notice that in some cases, the drop down appears at a random position on the screen, i.e. rather than connected to the relevant textbox, sometimes it appears with its entries above the textbox, not touching it at all. Sometimes it would have just one entry and it would appear in the middle of the screen vertically above the textbox it is associated to. Is there a reason why this is happening?

    Read the article

  • IE6 background-position(?) issue

    - by turezky
    I apply to stackoverflow as my last resort. I got this ie6 bug while using the image at the background of the link. It seems that ie6 scrolls the background. How can I avoid it? At some width it shows like this: And at some other it shows like that: IE7 & FF show this just like I expect: The links are placed inside the div which is floating to the right. <a href="/tr" class="menuLink" style="background-image:url(/img/tr.png);">TR</a> <a href="/eng" class="menuLink" style="background-image:url(/img/eng.png); margin-right:30px;">ENG</a> <a href="/logout" class="menuLink" style="background-image:url(/img/logout.png);"><?=$ui["exit"];?></a> .menuLink { font-family:"Tahoma"; font-size:11px; color:#003300; text-decoration:underline; font-weight: bold; background-position:0% 50%; background-repeat:no-repeat; } .menuLink:hover { font-size:11px; color:#047307; text-decoration:underline; font-weight: bold; } Any hints how can I avoid this?

    Read the article

  • Set the caret/cursor position to the end of the string value WPF textbox

    - by Zamboni
    I am try to set the caret/cursor position to the end of the string value in my WPF textbox when I open my window for the first time. I use the FocusManager to set the focus on my textbox when my window opens. Nothing seems to work. Any ideas? Note, I am using the MVVM pattern, and I included only a portion of the XAML from my code. <Window FocusManager.FocusedElement="{Binding ElementName=NumberOfDigits}" Height="400" Width="800"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBox Grid.Column="0" Grid.Row="0" x:Name="NumberOfDigits" IsReadOnly="{Binding Path=IsRunning, Mode=TwoWay}" VerticalContentAlignment="Center" Text="{Binding Path=Digits, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> <Button Grid.Column="0" Grid.Row="1" Margin="10,0,10,0" IsDefault="True" Content="Start" Command="{Binding StartCommand}"/> </Grid> </Window>

    Read the article

  • Android Web App : Position:fixed broken?

    - by StevenGilligan
    Hi all, I'm in the process of developping a Web Application for mobiles. I went with web applications because to me it seems a winning situation having to develop one application that could run also on iPhone / Windows Mobile / Palm etc. I started testing today after a few days of doing concepts, ideas and designs and what I wanted to do was have a menu that sticks at the bottom of the page. Exactly like the menu on the bottom in this iPhone application screenshot : http://farm4.static.flickr.com/3094/2656904921_1c54e93b4f.jpg Using CSS, I though it would be really easy to do this. Only using position:fixed; bottom:0; would have done the trick but I have found it doesn't behave the same on mobile browsers I tried to split my page in 2 sections : 1 would be a scrollable div (for the content) and the other one would be the bottom menu. Scrollable divs also do not work on Android. I also tried using frames with no luck either. Does anyone know of any way to re-create a menu that would stick to the bottom of a page for mobile phones? Thank you, Steven

    Read the article

  • Proposal for a new position at work

    - by Seth P.
    I have an idea at work for a new Product Manager position at our office. I work with several developers, and it would be helpful to have someone working in a type of "Scrum Master" capacity, dividing out assignments and making sure they get complete. This position does not currently exist, however I feel that I have enough evidence to indicate that it be very helpful for our business. What is the best way to present this proposal to my boss? Is there a specific template that you know of for new position? It should be able to describe the qualification for the position, their responsibilities, and what metrics we would use to measure them. Thanks. UPDATE++++ With Anna's suggestion, I gave more details about this specific position. However, I would ideally like the most generic way to present a new position to my boss.

    Read the article

  • dojo dgrid tree, subrows in wrong position

    - by Ventura
    I have a dgrid, working with tree column plugin. Every time that the user click on the tree, I call the server, catch the subrows(json) and bind it. But when it happens, these subrows are show in wrong position, like the image bellow. The most strange is when I change the pagination, after go back to first page, the subrows stay on the correct place. (please, tell me if is possible to understand my english, then I can try to improve the text) My dgrid code: var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]); var grid = new CustomGrid({ columns: [ selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"), {label:'Id', field:'id', sortable: false}, tree({label: "Title", field:"title", sortable: true, indentWidth:20, allowDuplicates:true}), //{label:'Title', field:'title', sortable: false}, {label:'Count', field:'count', sortable: false} ], store: this.memoryStore, collapseOnRefresh:true, pagingLinks: false, pagingTextBox: true, firstLastArrows: true, pageSizeOptions: [10, 15, 25], selectionMode: "single", // for Selection; only select a single row at a time cellNavigation: false // for Keyboard; allow only row-level keyboard navigation }, "grid"); My memory store: loadMemoryStore: function(items){ this.memoryStore = Observable(new Memory({ data: items, getChildren: function(parent, options){ return this.query({parent: parent.id}, options); }, mayHaveChildren: function(parent){ return (parent.count != 0) && (parent.type != 'DOC'); } })); }, This moment I am binding the subrows: success: function(data){ for(var i=0; i<data.report.length; i++){ this.memoryStore.put({id:data.report[i].id, title:data.report[i].created, type:'DOC', parent:this.designId}); } }, I was thinking, maybe every moment that I bind the subrows, I could do like a refresh on the grid, maybe works. I think that the pagination does the same thing. Thanks. edit: I forgot the question. Well, How can I correct this bug? If The refresh in dgrid works. How can I do it? Other thing that I was thinking, maybe my getChildren is wrong, but I could not identify it. thanks again.

    Read the article

  • Change Win7 taskbar position (overriding GPO, Registry Editor, Admin. Rights)

    - by diegocavazos53
    I run the computer center of my Faculty and the problem is that users manage to change the Win7 taskbar position. I don't really know how they do this as far as I have applied many group policies that are specific to the taskbar (like locking it). I have also disallowed users from entering new registry keys or executing the command prompt (or employing scripts). They have regular user rights and many Win7 tweaking programs need administrator rights to make changes to the GUI. So in other words, the taskbar is locked, there is a policy that sets its position to the lower part of the screen, users can't see the control panel, add registry keys, use the command prompt and don't have admin. rights. How do they keep moving the taskbar position to the upper part of the screen? Any ideas would be greatly appreciated. Thank you.

    Read the article

  • jquery treeview global saving position

    - by kusanagi
    i use such treeview http://docs.jquery.com/Plugins/Treeview/treeview, it saves perfect opened nodes when i click to subnodes links, but if i click on link, that is not in treeview the treeview is closes. for example- in treeview i have product categories, when click on category it loads list of products, but if i click on product details (this link not in treeview) then treeview is close. any ideas?

    Read the article

  • Set focus and carret position in textarea according to mouse position, as if user had clicked

    - by JeanHuguesRobert
    Once a page with a textarea is loaded, I want some textarea to have the focus immediatly if the mouse cursor is inside that textarea. This is the easy part because a onmousehover handler can set the focus. Now, how to I also set the position of the caret? I would like the caret to be where it would be if the user had clicked using the mouse to set the focus/caret. The basic use case is : User clicks on a link and waits (mouse barely moves) A page is delivered, it contains a big textarea only, full of text User types using keyboard Characters are inserted right below the mouse cursor Today the user has to wait until the caret is visible (at the top left of the textarea) and then click to move the caret before typing. Thanks!

    Read the article

  • iPhone UITextView position relative

    - by xenep
    Hi, i got a news page (a view) at my application and it has news' image and text. Text is in a UITextView and i want my text to start next to image and when the image ends continue from the down of the image, like the text is surrounding the image. i tried autoResizingMask but as i ve understood it is for the relations between subview and superview so it didnt work. Is there any way to do it ? Thanx in advance

    Read the article

  • Header Div Position Edit according to Content Div

    - by Melih Mucuk
    I want to design my web site. I have two main div, one of them "header", other "content". I want to set width property:80% and I set center for both of them. But I don't do that. Other question about header div. I uploaded an image and I want to design like this. How can I do all of them? My CSS: #main { margin:0px auto; margin-left:50px; margin-right:50px; margin-top:25px; margin-bottom:25px; height:auto; text-align:center;} #content { width:80%; height:auto; margin:0px auto; } #header { width:80%; height:100px; top:20px; } #header_left { float:left ; height: 100px; text-align: center; } #header_right { margin:0px auto; height:30px; text-align:center; margin-top:35px; } #header_social { float:right; height:30px; text-align:center; margin-top:35px;} My client code: <div id="main"> <div id="content"> <div id="header"> <div id="header_left"> <asp:Image ID="Image1" runat="server" /> </div> <div id="header_right"> <asp:LinkButton ID="LinkButton5" runat="server" ForeColor="Gray"></asp:LinkButton>&nbsp;| <asp:LinkButton ID="LinkButton4" runat="server" ForeColor="Gray" ></asp:LinkButton>&nbsp;| <asp:LinkButton ID="LinkButton3" runat="server" ForeColor="#FF3300" ></asp:LinkButton>&nbsp;| <asp:LinkButton ID="LinkButton2" runat="server" ForeColor="Gray" ></asp:LinkButton>&nbsp;| <asp:LinkButton ID="LinkButton1" runat="server" ForeColor="Gray" ></asp:LinkButton> </div> <div id="header_social"> <asp:ImageButton ID="ImageButton1" runat="server"/> <asp:ImageButton ID="ImageButton2" runat="server"/> </div> </div> ******CONTENT FIELD***** </div> </div>

    Read the article

  • Getting javascript mouse position relative to website prefferably without jQuery

    - by Constructor
    I've found this snippet on Ajaxian, but I can't seem to use the cursor.y (or cursor.x) as a variable and when the function is called as such it does not seem to work. Is there a syntax problem or something else? function getPosition(e) { e = e || window.event; var cursor = {x:0, y:0}; if (e.pageX || e.pageY) { cursor.x = e.pageX; cursor.y = e.pageY; } else { cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; } return cursor; } I'd preffer not to use jQuery UI if possible, since I've always thaught of jQuery and librarys as a bit of an overkill for most JS programing.

    Read the article

  • Getting mouse position both in Internet explorer and firefox with javascript

    - by strakastroukas
    I read this article regarding creating popup notes with javascript and css The problem is that this one works only in IE since window.event is undefined in Firefox. // assigns X,Y mouse coordinates to note element note.style.left=event.clientX; note.style.top=event.clientY; So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?

    Read the article

  • Getting mouse position in major internet browswers with javascript

    - by strakastroukas
    I read this article regarding creating popup notes with javascript and css The problem is that this one works only in IE since window.event is undefined in Firefox. // assigns X,Y mouse coordinates to note element note.style.left=event.clientX; note.style.top=event.clientY; So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?

    Read the article

  • jquery animate background-position firefox

    - by Ohnegott
    I got this background image slider thing working in chrome and safari, but it doesnt do anything in firefox. any help? $(function(){ var image= ".main-content"; var button_left= "#button_left"; var button_right= "#button_right"; var animation= "easeOutQuint"; var time= 800; var jump= 800; var action= 0; $(button_left).click(function(){ right(); }); $(button_right).click(function(){ left(); }); $(document).keydown(function(event){ if(event.keyCode == '37'){ right(); } }); $(document).keydown(function(event){ if(event.keyCode == '39'){ left(); } }); function left(){ if(action == 0){ action= 1; $(image).animate({backgroundPositionX: '-='+jump+'px'}, {duration: time, easing: animation}); setTimeout(anim, time); } } function right(){ if(action == 0){ action= 1; $(image).animate({backgroundPositionX: '+='+jump+'px'}, {duration: time, easing: animation}); setTimeout(anim, time); } } function anim(){ action= 0; } }); I also tried this but it also does nothing $(image).animate({backgroundPosition: '500px 0px'}, 800);

    Read the article

  • PHP controllable menubar position

    - by craide
    I'm an admin for a page and I want to give certain users dynamic control of the menubar layout. The ideal would be a page with a list with menu items and arrows pointing up and down with each item and when you click them the item is reordered. I have a pretty basic idea of how I can do it but I would like some suggestions. The items are stored in MySQL and I only need help figuring out how the items should be ordered or numbered and how to re-order them. This probably needs some javascript trickery and I'm not familiar with JS.

    Read the article

  • PHP - Read TXT from specific position

    - by user1466766
    I'm having trouble with PHP text parsing I have a txt file which has this kind of information: sometext::sometext.0 = INTEGER: 254 What i need is to get the last value of 254 as variable in PHP. in this txt file this last value can change from 0 to 255 "sometext::sometext.0 = INTEGER: " this part doesn't change at all. It has a length of 36 symbols, so i need get with PHP what is after 36 symbol into variable. Thank you.

    Read the article

  • position content relative to a fluid width element set to position:fixed

    - by Star
    I have a layout with the following requirements An image on the left side, and content on the right side. The image is pinned to the bottom left of the viewport The image does not move when the user scrolls The image resizes to 100% height of the viewport, up to it's max height. (I don't want the image to distort in it's attempts to be larger than it actually is) The image retains it's aspect ratio, and resizes it's width according to the height resizing. The content begins to the right of the image, and moves as the image resizes with the browser viewport. Now, I've managed to achieve pretty much all but the last of these requirements. Have a look here: http://letteringmusic.com/ The image resizes quite nicely, but I can't get the content to float next to the image because image is position:fixed, and therefore out of the document flow. I'm not opposed to a javascript solution if that's the only way to get the result I want. Anybody know what I need to do to make this work? Thank you!!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >