I want to some kind of option list when i hold a selection in a listbox. And i didn't find something default that does this, so i'm trying to build one of my own. So first is there such a feature in windows phone 7?
If not, then i need to open a combo box of listbox at the specified position where the selection event happened, i found out how to get the coordinates of the event as follows:
System.Windows.Point position = e.GetPosition(this);
double pX = position.X;
double pY = position.Y;
Howerver, i can't find a way to set the coordinates of the combobox for example in the view to those coordinates or so.
Help please
Perhaps what you want is a ContextMenu - there is one available in the Silverlight Toolkit for Windows Phone.
Related
I am building a mini project where I want to have a color picker feature. I found the Digital Color Meter on macOS is helpful. I did some search and found I can write a simple AppleScript to activate the application.
It would be awesome if I can monitor the next left-click mouse event (even if I am not focusing Digital Color Meter application). By monitoring the next left-click mouse event, I want to get the value from the R, G and B options as you can see from the image above.
I think mouse event handler should be able to achieve (though I don't know how to do it). I am not sure whether I can read the value from the Application...
Simply use
choose color
from Standard Scripting Additions.
In the color picker window there is also a eyedropper (pipette).
I recently noticed the following popup message ("6 occurrences replaced") in Qt Creator (3.4.2).
I like its style and want to use it in my own application. But how is it done? Is this a particular widget or what else? Can someone point me in the right direction.
You could create your own window with round corners like that with text in the middle paid show it when you want too make the window so it takes a parameter text and you can add different text each time and show
In Windows phone, how do I find the VerticalOffset of a button? I have a ScrollView with a bunch of content. I want to use ScrollViewer.ScrollToVerticalOffset to get to a specific point (a button), but don't know how to get the position of that point.
if you have both items, you should be able to use TransformToVisual to get the location of one control relative to another, then use that to scroll
see http://msdn.microsoft.com/en-us/library/system.windows.media.visual.transformtovisual.aspx
This is how I get the x and y coordinates of two buttons in my app and move them. Maybe you can do something similar:
Canvas.SetLeft(imUp, Canvas.GetLeft(imUp) + offsetX);
Canvas.SetLeft(imDown, Canvas.GetLeft(imDown) + offsetX);
My application is screenshot maker. User needs to select screen area to make a screenshot. I use Win32 API with PureBasic, but it doesn't matter, all is similar with C++.
When user runs application, the semitransparent borderless form is shown on full screen to hook mouse over all other windows. On mouse down event selection is started and I apply XORed region to the form to cut a hole in it with size of current selection.
I create and apply a new region on every mousemove event:
rgn1 = CreateRectRgn_(0,0,DWidth,DHeight) ; full size of desktop
rgn2 = CreateRectRgn_(sx, sy, ex, ey) ; current selection points
CombineRgn_(rgn1, rgn1, rgn2, #RGN_XOR)
SetWindowRgn_(WindowID(0), rgn1, #True); apply region
It works well on my computer with Windows XP, but works buggy on other computer with Vista. I think it is wrong when I create the new region object on every mouse move. Maybe I need to create it once and then to resize? Can anybody explain how to do this right? Examples on C++ are ok.
In the beginning you create region, using CreateRectRgn (like in your code).
Then it's enough to call SetRectRgn function for updating region bounds
Is there a way to make combobox be dropping up instead of down?
I have answered that Q but it's in Delphi (the code is not so hard to understand though):
Can I programmatically set the position of ComboBox dropdown list?
You need to subclass the ComboBox hwndList (You obtain that handle via GetComboBoxInfo API) using SetWindowLong (GWL_WNDPROC) and handle WM_MOVE message to place that hwndList in a new position.
Not with the standard Windows combo boxes (Here are the available styles for combo boxes).
As #ILMV said, Windows will drop the box up instead of down if there is not enough space below the box.
You can test this with notepad - go to format -> font, and drag the box down so that the Script combo box is just above the start menu. Click the combo box - it drops up.
If you want it to always drop up, you'll have to make your own.