Can TaskbarItemInfo ThumbnailClipMargin support negative numbers?
-
viernes, 03 de agosto de 2012 23:24
For example:
<Window.TaskbarItemInfo> <TaskbarItemInfo ThumbnailClipMargin="-100,-100,100,100"></TaskbarItemInfo> </Window.TaskbarItemInfo>
But,it doesn't work.
I use another method:
public MainWindow_Loaded() { this.LayoutUpdated += new EventHandler(LayoutUpdated); this.UpdateTaskbarPreview(); } void LayoutUpdated(object sender, EventArgs e) { this.UpdateTaskbarPreview(); } void UpdateTaskbarPreview() { RECT rect = new RECT(-100,-100,100,100); TaskbarManager.Instance.SetThumbnailClip(new System.Windows.Interop.WindowInteropHelper(this).Handle, rect); }But,it doesn't work too.If all the numbers are positive,It works:
public MainWindow_Loaded() { this.LayoutUpdated += new EventHandler(LayoutUpdated); this.UpdateTaskbarPreview(); } void LayoutUpdated(object sender, EventArgs e) { this.UpdateTaskbarPreview(); } void UpdateTaskbarPreview() { RECT rect = new RECT(100,100,100,100); TaskbarManager.Instance.SetThumbnailClip(new System.Windows.Interop.WindowInteropHelper(this).Handle, rect); }
- Editado yqhszn20j sábado, 04 de agosto de 2012 1:37
Todas las respuestas
-
domingo, 05 de agosto de 2012 8:07Nobody knows?
-
domingo, 05 de agosto de 2012 21:52Why do you need negative margin? Do you need to see desktop on the thumb?
-
lunes, 06 de agosto de 2012 6:56
I don't need to see desktop on the thumb.
I need to see a whole child element,such as:
<Window ……> <Grid Width="600" Height="600"> <Button Name="b1" Width="200" Height="200"
FontSize="80" VerticalAlignment="Top"
HorizontalAlignment="Left" Content="Hello"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X="-100" Y="100"></TranslateTransform> </TransformGroup> </Button.RenderTransform> </Button> </Grid> </Window>
I need to see the whole b1 on the thumb. Can I?
-
lunes, 06 de agosto de 2012 6:58
Why do you need negative margin? Do you need to see desktop on the thumb?
I don't need to see desktop on the thumb.
I need to see a whole child element,such as:
<Window ……> <Grid Width="600" Height="600"> <Button Name="b1" Width="200" Height="200"
FontSize="80" VerticalAlignment="Top"
HorizontalAlignment="Left" Content="Hello"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X="-100" Y="100"></TranslateTransform> </TransformGroup> </Button.RenderTransform> </Button> </Grid> </Window>
I need to see the whole b1 on the thumb. Can I?
-
lunes, 06 de agosto de 2012 8:25Moderador
Hi yqhszn20j,
"ThumbnailClipMargin" property does not support negative value, as far as I know, any negative, NaN or infinity value will be treated as zero value.
Best regards,
Sheldon _Xiao[MSFT]
MSDN Community Support | Feedback to us
Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marcado como respuesta yqhszn20j martes, 07 de agosto de 2012 5:51
-
lunes, 06 de agosto de 2012 20:22
On window client area starts from top left ( cooordinates 0 0). Margins are offsets of windows client area(left,top,right,bottom). negative values are not on the visible parts of the window. If you translate button to the negative side of the windows it will be clipped eventually.
Regards..

