forked from Tulpep/Notification-Popup-Window
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
519 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Imports Microsoft.VisualBasic.ApplicationServices | ||
|
||
Namespace My | ||
' The following events are available for MyApplication: | ||
' Startup: Raised when the application starts, before the startup form is created. | ||
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. | ||
' UnhandledException: Raised if the application encounters an unhandled exception. | ||
' StartupNextInstance: Raised when launching a single-instance application and the application is already active. | ||
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. | ||
|
||
' **NEW** ApplyHighDpiMode: Raised when the application queries the HighDpiMode to set it for the application. | ||
|
||
' Example: | ||
|
||
' Private Sub MyApplication_ApplyHighDpiMode(sender As Object, e As ApplyHighDpiModeEventArgs) Handles Me.ApplyHighDpiMode | ||
' e.HighDpiMode = HighDpiMode.PerMonitorV2 | ||
' End Sub | ||
|
||
Partial Friend Class MyApplication | ||
|
||
End Class | ||
End Namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net5.0-windows</TargetFramework> | ||
<RootNamespace>DemoApp.VB</RootNamespace> | ||
<StartupObject>Sub Main</StartupObject> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<MyType>WindowsForms</MyType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Import Include="System.Data" /> | ||
<Import Include="System.Drawing" /> | ||
<Import Include="System.Windows.Forms" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NotificationWindow\NotificationWindow.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="My Project\Application.Designer.vb"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Application.myapp</DependentUpon> | ||
</Compile> | ||
<Compile Update="My Project\Resources.Designer.vb"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Update="My Project\Resources.resx"> | ||
<CustomToolNamespace>My.Resources</CustomToolNamespace> | ||
<Generator>PublicVbMyResourcesResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.vb</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="My Project\Application.myapp"> | ||
<Generator>MyApplicationCodeGenerator</Generator> | ||
<LastGenOutput>Application.Designer.vb</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<root> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
<xsd:complexType> | ||
<xsd:choice maxOccurs="unbounded"> | ||
<xsd:element name="metadata"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" use="required" type="xsd:string" /> | ||
<xsd:attribute name="type" type="xsd:string" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="assembly"> | ||
<xsd:complexType> | ||
<xsd:attribute name="alias" type="xsd:string" /> | ||
<xsd:attribute name="name" type="xsd:string" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="data"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="resheader"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:choice> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>2.0</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Public Class Form1 | ||
Private Sub btnShow_Click(sender As Object, e As EventArgs) Handles btnShow.Click | ||
Dim notify = New NotificationWindow.PopupNotifier() | ||
notify.Image = My.Resources.icon | ||
notify.ContentText = "test" | ||
notify.Popup() | ||
End Sub | ||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Option Strict On | ||
Option Explicit On | ||
|
||
'This constant indicates whether the Application Framework is in use. | ||
#Const APPLICATION_FRAMEWORK = True | ||
|
||
#If APPLICATION_FRAMEWORK Then | ||
|
||
#If NET5_0 And Not NET6_0 Then | ||
|
||
Imports System.Collections.ObjectModel | ||
|
||
Namespace My | ||
|
||
Partial Friend Class MyApplication | ||
|
||
Public Event ApplyHighDpiMode(sender As Object, e As ApplyHighDpiModeEventArgs) | ||
|
||
Private _highDpiMode As HighDpiMode? | ||
|
||
Friend Shadows Property HighDpiMode As HighDpiMode | ||
Get | ||
Return If( | ||
_highDpiMode Is Nothing, | ||
Application.HighDpiMode, | ||
_highDpiMode.Value) | ||
End Get | ||
Set(value As HighDpiMode) | ||
_highDpiMode = value | ||
End Set | ||
End Property | ||
|
||
' IMPORTANT: | ||
' If this method causes an compilation error after you've unchecked 'Application Framework' | ||
' in the project properties, go to the top of this file and change the value to 'False' in this line: | ||
' #Const APPLICATION_FRAMEWORK = False | ||
|
||
' For more about using WinForms without the Application Framework | ||
' see: https://aka.ms/visualbasic-appframework-net5 | ||
Protected Overrides Function OnInitialize(commandLineArgs As ReadOnlyCollection(Of String)) As Boolean | ||
Dim eventArgs = New ApplyHighDpiModeEventArgs( | ||
If( | ||
_highDpiMode Is Nothing, | ||
HighDpiMode.SystemAware, | ||
_highDpiMode.Value)) | ||
|
||
RaiseEvent ApplyHighDpiMode(Me, eventArgs) | ||
|
||
Windows.Forms.Application.SetHighDpiMode(eventArgs.HighDpiMode) | ||
|
||
Return MyBase.OnInitialize(commandLineArgs) | ||
End Function | ||
End Class | ||
|
||
Public Class ApplyHighDpiModeEventArgs | ||
Inherits EventArgs | ||
|
||
Public Sub New(highDpiMode As HighDpiMode) | ||
Me.HighDpiMode = highDpiMode | ||
End Sub | ||
|
||
Public Property HighDpiMode As HighDpiMode | ||
|
||
End Class | ||
|
||
End Namespace | ||
|
||
#End If ' #If NET5_0 And Not NET6_0 | ||
#End If ' #If APPLICATION_FRAMEWORK |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<MySubMain>true</MySubMain> | ||
<MainForm>Form1</MainForm> | ||
<SingleInstance>false</SingleInstance> | ||
<ShutdownMode>0</ShutdownMode> | ||
<EnableVisualStyles>true</EnableVisualStyles> | ||
<AuthenticationMode>0</AuthenticationMode> | ||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit> | ||
</MyApplicationData> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.