NotifyIcon Context Menu Position Fix
This commit is contained in:
1 parent
0f9cbd11dd
commit
40f5491f5c
4 files changed
+10
-12
No files matched your search
@@ -18,3 +18,7 @@ src/Net_GE45/HandyControl_Net_GE45/obj
|
||||
src/Net_GE45/HandyControlDemo_Net_GE45/bin
|
||||
src/Net_GE45/HandyControlDemo_Net_GE45/obj
|
||||
*.user
|
||||
/.vs/HandyControl/v16/.suo
|
||||
/.vs/ProjectSettings.json
|
||||
/.vs/VSWorkspaceState.json
|
||||
/.vs/slnx.sqlite
|
||||
@@ -36,7 +36,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -56,7 +56,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU' ">
|
||||
@@ -66,7 +66,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\HandyControl.xml</DocumentationFile>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
|
||||
@@ -322,8 +322,6 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ShowContextMenu()
|
||||
{
|
||||
var point = new POINT();
|
||||
UnsafeNativeMethods.GetCursorPos(point);
|
||||
|
||||
if (ContextContent != null)
|
||||
{
|
||||
@@ -331,14 +329,12 @@ namespace HandyControl.Controls
|
||||
{
|
||||
_contextContent = new Popup
|
||||
{
|
||||
Placement = PlacementMode.AbsolutePoint,
|
||||
Placement = PlacementMode.Mouse,
|
||||
AllowsTransparency = true,
|
||||
StaysOpen = false
|
||||
};
|
||||
}
|
||||
|
||||
_contextContent.HorizontalOffset = point.x;
|
||||
_contextContent.VerticalOffset = point.y;
|
||||
_contextContent.Child = new ContentControl
|
||||
{
|
||||
Content = ContextContent
|
||||
@@ -354,9 +350,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else if (ContextMenu != null)
|
||||
{
|
||||
ContextMenu.Placement = PlacementMode.AbsolutePoint;
|
||||
ContextMenu.HorizontalOffset = point.x;
|
||||
ContextMenu.VerticalOffset = point.y;
|
||||
ContextMenu.Placement = PlacementMode.Mouse;
|
||||
ContextMenu.IsOpen = true;
|
||||
|
||||
var handle = IntPtr.Zero;
|
||||
|
||||
Reference in new issue
Block a user