重叠投影效果(Overlap Drop Shadow Effect)
我知道我想要做的事很可能是简单而明显的,但我无法解决这个问题。 我有一个两行的网格,最上面一行有一个填充行的边框元素(固定高度为30)。 第二行(固定高度为100)当前包含一个空白的DockPanel,其背景为白色(这将包含动态控件的ContentControl)。
我在第一行的边框中添加了阴影效果,方向为270,将阴影放在边界下方。 由于没有足够的空间来容纳阴影,所以这并不令人惊讶。 我想要的是阴影从行中溢出并覆盖下面一行中的DockPanel。
我通过让含有白色背景的网格来实现这一点,然后向边框元素添加底部边距以适应阴影。 虽然这看起来不错,但它并不是我想要实现的。
对于没有代码示例的道歉,我不得不离开工作,但这仍然困扰着我。
提前致谢。
保罗
I know what I want to do is probably easy and obvious but I cannot work it out. I have a grid with two rows, the top row has a border element which fills the row (Fixed height of 30). The second row (Fixed Height of 100) currently contains an empty DockPanel with a white background (this will contain ContentControl for dynamic controls).
I added a drop shadow effect to the border in the first row, with a direction of 270 to drop the shadow below the border. It is barely visible which is not a surprise as there is not enough space to accommodate the shadow. What I want is for the shadow to overflow from the row and overlap the DockPanel in the row below.
I sort of achieved this by having the containing grid with a white background as well and then add a bottom margin to the border element to accommodate the shadow. Whilst this looks OK, it is not really what I'm trying to achieve.
Apologies for no code example, I had to leave work but this is still bothering me.
Thanks in advance.
Paul
原文:https://stackoverflow.com/questions/9487716
最满意答案
尝试这个:
// On click private void button1_Click(object sender, RoutedEventArgs e) { ContextMenuService.GetContextMenu(button1).IsOpen = true; } // On right-click private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { e.Handled = true; }
Try this:
// On click private void button1_Click(object sender, RoutedEventArgs e) { ContextMenuService.GetContextMenu(button1).IsOpen = true; } // On right-click private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { e.Handled = true; }
相关问答
更多-
您应该在代码中分配ContextMenu Style属性( FindResource方法msdn ): private void fileButton_Click(object sender, RoutedEventArgs e) { if (fileButton.ContextMenu.Style == null) fileButton.ContextMenu.Style = this.FindResource("ContextMenuStyle") as Style; f ...
-
最后我使用了这个解决方案: http : //www.c-sharpcorner.com/uploadfile/baimey/silverlight-charts-coordinates-on-mousemove/ 我想我最好发布它以防其他人需要这个。 private void Chart_MouseRightButtonUp(object sender, MouseButtonEventArgs e) { Series serie = sender as Series; ...
-
对不起愚蠢的帖子,我一定比我想的更累。 不认为只是覆盖menubutton并在那里添加代码,因为我之前没有使用它。 这个帖子为我解决了: 截取菜单点击 Sorry for stupid post, I must be more tired than I thought. Wasn't thinking that it is just to Override the menubutton and add the code there, since I'm not using that before. This ...
-
使用event.preventDefault() ,在调用时,不会触发事件的默认操作。 还可以使用.on('click', function())处理程序绑定您的click事件 $(".imgbtnUpdateContext").on('click', function (e) { //Ajax Call Does action success: function (JSONData) { try { $(".dialogADD").dialo ...
-
尝试这个: // On click private void button1_Click(object sender, RoutedEventArgs e) { ContextMenuService.GetContextMenu(button1).IsOpen = true; } // On right-click private void button1_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { e.Han ...
-
如何在左键单击而不是右键单击打开D3.js上下文菜单(How to open D3.js Context Menu on left click instead of Right click)[2023-12-24]
如果你更改jsfiddle中的行: .on('contextmenu', function(d, i) { 至 .on('mousedown', function(d, i) { 你应该得到一个弹出的动作。 我注意到你有一些其他点击和preventDefault()调用,所以这些可能与点击事件冲突。 If you change the line in the jsfiddle: .on('contextmenu', function(d, i) { to .on('mousedown', functi ... -
看来每次在表体内右键单击时,都会创建一个新的上下文菜单实例。 相反,如果您为上下文菜单应显示的内容定义选择器,则菜单将仅显示在那里。 如果上下文菜单将显示在随机项上,则应使用类定义这些项,并且可以从该类实例化上下文菜单。 http://jsfiddle.net/azSMq/ $(function() { var menu1 = [ { 'Open Item information': { onclick: function(menuItem, ...
-
看看IEvaluationService.requestEvaluation(String propertyName) ......它完全符合您的需求。 您可以像访问所有其他服务一样从网站获得评估服务: IEvaluationService es = (IEvaluationService)getSite().getService(IEvaluationService.class); Have a look at IEvaluationService.requestEvaluation(String pr ...
-
Are you sure you want to open context Menu on Click of Menu button? 因为, 上下文菜单用于特定视图, 上下文菜单提供影响UI中特定项目或上下文框架的操作。 您可以为任何视图提供上下文菜单,但它们通常用于ListView,GridView或其他视图集合中的项目,用户可以在其中对每个项目执行直接操作。 要在长按下显示上下文菜单,大多数客户端将要调用registerForContextMenu(View)并覆盖onCreateContextMe ...
-
一个简单的解决方案是更新按钮事件处理程序,以便在上下文菜单当前未打开时模拟右键单击。 private void BtnMessageChannel_Click(object sender, RoutedEventArgs e) { if (!BtnMessageChannel.ContextMenu.IsOpen) { e.Handled = true; var mouseRightClickEvent = n ...