I am working on a silverlight application that has to capture electronic signature from user as a part of it's functionality. I was able to build a PoC based on Silverlight Ink Presenter control, when the page renders I have designated a rectangular region into which user has to input his signature.
This absolutely works like a charm, but, I wsa not able to restrict pointing device to rectangular region so it can currently go out of the region irritating the user. User has to get it back to the rectangular region to input his signature. I would like to know if there is a way to restrict cursor to a rectangular region of the web page.
Something similar to "Cursor.Clip" of Windows.Forms
Any help is highly appreciated.
Try designing your own cursor as the pointer enters the region and hide the pointer. Set the bounds of the custom cursor to stay with int rectangle
here's a link for custom cursor
custom cursor
Only problem is as you move it along with the mouse pointer then mouse pointer can move out but this cursor wont. Rest of the code you need to modify so that user sticks to the particular edges
Related
I am making an app with panoramic view where the user can select a color hue, saturation and value from a color wheel and SV graph like this:
http://i.imgur.com/JM1FD1z.jpg
http://i.imgur.com/51ymotz.jpg
The user can either tap or drag a pointer across the square, coordinates determine the values. But when they drag(mousemove), the app will also slide to the next screen.
Is there a way I can disable the slide to next page if the sliding is done within the graph? It should function normally outside the graph area.
Something like a disable panoramic slide function that can be implemented within the graphs mousemove event handler?
Putting the hue wheel and SV-graph on separate pages will dramatically reduce the combined dynamic functionality of the two so I'd prefer them to be on one panoramic page.
This doesn't seem a good use of a panorama. This will lead to "gesture competition" between the touch action on the controls and the panorama itself. The same problem arises if you use a Pivot control.
If you want Hue and SV on the same page, why don't you put them on the same page and allow switching of the mode by a button, say on the app bar?
You can have both controls in the XAML tree and show the one which is active and hide the other. You can do this by changing the Visibility of each control.
I want to make a small box that will be visible after PointerEntered event on bing map. I need to get the position of pointer when the pointer is over the pushpin. Everything works but I can't get the position. I need it so I can dynamicly show the box in correct place near the pushpin.
How can I get cursor/pointer position ?
I don't think it's a good idea trying to rely too much on pointer position in Windows Store apps. Don't forget about your touch based users - how are you going to determine the pointer position in their case?
I haven't used Bing maps and pushpins in a Windows Store app yet, but maybe you could try using tooltips instead. They already have built-in support for both touch based and mouse based control and they even position themselves automatically in such a way that the user doesn't obsure them with his finger.
Hello,
Above is the program I am writing. On the right panel is basically two custom controls (the blue rectangle area) I created and just added them as controls to the background panel control when this winform program loads.
I used MS paint to draw out the pop up balloon that I want to see when my mouse enter this control's area. I want to do the following:
1. If mouse enter the control area, the yellow area balloon pop up and populate with the information of that specific control
2. If mouse move out of the control area, the pop up balloon disappear.
Can this be done with Winform application? I looked around and found out about Tooltip class but so far from researching I don't know if it does what I want to do.
I could be wrong but googling around gave me the impress that Tooltip offers very little in term of style. Ideally I want to make this pop up balloon into almost like a border-less pop up window where I can put image , font ect.....at will. Also Tooltip works if you hover over a button or specific field whereas I want the entire control area.
Can this be done? I appreciate if you can point me to any work around if there is one.
I wrote a comment, but I figure I'll expand it into a full answer. This is assuming you want a new control, which isn't a tooltip, for maximum customizability. I did something similar to this for work recently, to act as a non-modal info popup that disappears when clicked.
Creating a Custom Popup Form
What you want is essentially a floating popup that appears over your form, which means you'll want to define a new Form object, rather than a UserControl, as it won't actually be embedded within your other form.
Give it a multiline, non-editable textbox that you can fill with the information you want to populate, then simply call a new instance of the form on your Mouse_Enter event. Close it upon Mouse_Leave.
Adjusting The Style
You'll have to play with it a bit to get it to actually act like a popup and not just a window. I'd recommend setting it to a non-modal popup, and removing the border. You can write a function to automatically size it to its contents. I don't imagine you'll want the user manually resizing it.
Some other things to look into would be overriding the CreateParams property that comes with the basic Form object. You can force DropShadows and TopMost forms without making the form modal. Overriding ShowWithoutActivation to always return true will prevent the form from stealing focus when it pops up.
I'm not sure if you can pull off rounded edges like you have in your mockup. Perhaps you can pull it off with some wizardry in the OnPaint() function, but I couldn't tell you how to do it.
It might be a bit of a pain for fiddling around with, but you can get some good functionality and appearance out of it. If you think you can pull it off acceptably with the ToolTip class, go for it. It took me about a week to get my notifications where I wanted them (though I added several features that you probably don't need to worry about).
Examples
Some keywords to look up in related searches would be Toast Notification and Non-Modal Popup. This might be some use:
http://www.codeproject.com/Articles/442983/Android-Style-Toast-Notification-for-NET
Since you already have implemented custom user controls you might want to try it again. Make a control that is that style and color, changes it's size based on it's text. You can feed it information (such as the text to display) from your existing user control object. You can also have the mouse enter/leave code reside in your first user control.
If you're not sure how to make a rectangle with round corners you can either make it on the fly using a graphics object (which will turn into a bitmap on the screen) or make it how you want it to look in GIMP (or photoshop if you have it) then use that image as the background on your user control. Make the default background transparent (so your voids above the round corners are not grey). If you make a pre loaded image you'll need to be aware you will only be able to scale it equally in Y and X directions. unequal scaling will make it look distorted.
Can you use the Mouse_Enter event on the control?
The scenario is that i want the user to create a shape in a small panel that opens (the added shape can later be placed on the canvas), but for a better reference, i want the user to be able to move the semi-transparent panel somewhere on the canvas and then draw with the accurate reference.
Please tell me:
Which panel type to use
How to make it moving by clicking the mouse on the move button (not the whole panel as dragging will be used for drawing lines) and move it around.
How to make it semi transparent.
How to make it appear and disappear (this should be pretty simple)
How to somehow limit its movement inside the canvas so it cannot move on the ribbon
And I really really hope there will be something built-in in WPF that i'll be able to use, and i will not have to do it the hard way i.e. create a rectangle, and do customized hit testing on it to allow the user to draw on top of that rectangle, make that rectangle transparent, and add graphics items for the buttons and controls on that rectangle "panel".
I am asking this because i have never seen such feature in any Windows application and i have no idea what to use for this purpose and how to implement it. The closest thing to what i want is in Adobe Acrobat Pro, which is the small preview of the page that appears when i double click with the middle mouse button. It doesn't move, nor it is transparent or can be drawn upon, but scale and shape wise i want something similar.
You should be able to place a second Canvas inside of your main canvas, and place whatever UserControl you'd like with your "view" inside of it.
You'll have to handle the mouse click/drag for moving it around yourself, but otherwise, it should be very straightforward.
I have a large user drawn control that fills most of the screen area in an application.
I would like to simulate some "onMouseHover" behaviour, I cant really use the userControl event as the mouse is almost always on that control so it fires all of the time.
How can I detect the mouse "hovering" over part of my user drawn control?
(If it helps an image of the app can be found at : http://www.benbun.co.uk/st3/ayv the control is the large "year calendar")
You could handle MouseMove events instead of MouseHover. Then you could calculate based on the X,Y location of the mouse whether or not the cursor is in the part of your control you are interested in creating "hover" behavior for.