当前位置: 首页 > news >正文

大连做网站排名竞价托管服务多少钱

大连做网站排名,竞价托管服务多少钱,丰台做网站的公司,新闻类网站怎么建设1.思路 1.1 样式 样式为常驻前台的一个小窗口,小窗口上有三到四个按钮,为一级功能,是当前工作内容的常用功能窗口,有十个二级窗口,为选中窗口时的扩展选项,有若干后台功能,可选中至前台 可最…

1.思路

1.1 样式

样式为常驻前台的一个小窗口,小窗口上有三到四个按钮,为一级功能,是当前工作内容的常用功能窗口,有十个二级窗口,为选中窗口时的扩展选项,有若干后台功能,可选中至前台

可最小化至窗口栏,最小化按钮在窗口底部

窗口为无边框

1.2具体功能

1.设置代办

复制一段文本后添加代办

2.复制填表

2.功能细节

1.窗口名称:Me.Text = "工作助手"

2.常驻前台Me.TopMost = True

3.无边框Me.FormBorderStyle = FormBorderStyle.None

4.窗体圆角 

引用:Imports System.Drawing.Drawing2D

    Call 窗体圆角(Me, 20)Sub 窗体圆角(form As Form, rgnRadius As Integer)Dim bs As GraphicsPath = New GraphicsPathbs.AddLine(rgnRadius, 0, Me.Width - rgnRadius * 2, 0)bs.AddArc(Me.Width - rgnRadius * 2, 0, rgnRadius * 2, rgnRadius * 2, 270, 90)bs.AddLine(Me.Width, rgnRadius, Me.Width, Me.Height - rgnRadius * 2)bs.AddArc(Me.Width - rgnRadius * 2, Me.Height - rgnRadius * 2, rgnRadius * 2, rgnRadius * 2, 0, 90)bs.AddLine(Me.Width - rgnRadius * 2, Me.Height, rgnRadius, Me.Height)bs.AddArc(0, Me.Height - rgnRadius * 2, rgnRadius * 2, rgnRadius * 2, 90, 90)bs.AddLine(0, Me.Height - rgnRadius * 2, 0, rgnRadius * 2)bs.AddArc(0, 0, rgnRadius * 2, rgnRadius * 2, 180, 90)bs.CloseFigure()Me.Region = New Region(bs)End Sub

可是用画图法制作的窗体圆角有很明显的锯齿,不符合商业化需求

使用双缓冲
默认情况下,标准Windows 窗体控件是双缓冲的。
可以通过两种方法对窗体和所创作的控件启用默认双缓冲。
一种方法是将DoubleBuffered属性设置为true,另一种方法是通过调用SetStyle方法将OptimizedDoubleBuffer标志设置为true。两种方法都将为窗体或控件启用默认双缓冲并提供无闪烁的图形呈现。建议仅对已为其编写所有呈现代码的自定义控件调用SetStyle方法。

Public Sub New()

InitializeComponent()

SetStyle(ControlStyles.UserPaint, True)

SetStyle(ControlStyles.AllPaintingInWmPaint, True)

SetStyle(ControlStyles.OptimizedDoubleBuffer, True)

End Sub

最后尝试了双重绘,但是又出现黑角

Imports System.Drawing.Drawing2D
Imports System.Runtime.InteropServicesPublic Class Form1Public Sub New()' 此调用是设计器所必需的。InitializeComponent()SetStyle(ControlStyles.UserPaint, True)SetStyle(ControlStyles.AllPaintingInWmPaint, True)SetStyle(ControlStyles.OptimizedDoubleBuffer, True)Me.Text = "工作助手"Me.TopMost = TrueMe.FormBorderStyle = FormBorderStyle.None'Call 窗体圆角(Me, 20)End SubProtected Overrides Sub OnPaintBackground(e As PaintEventArgs)' 不调用基类的OnPaintBackground,避免背景被画出End SubProtected Overrides Sub OnPaint(e As PaintEventArgs)Dim g As Graphics = e.Graphicsg.SmoothingMode = Drawing2D.SmoothingMode.AntiAliasg.CompositingQuality = Drawing2D.CompositingQuality.HighQualityg.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic'绘制圆角矩形Dim rect As New Rectangle(0, 0, Me.Width, Me.Height)Dim path As New Drawing2D.GraphicsPath()Dim ar As Integerar = 50path.AddArc(rect.X, rect.Y, ar, ar, 180, 90)path.AddArc(rect.X + rect.Width - ar, rect.Y, ar, ar, 270, 90)path.AddArc(rect.X + rect.Width - ar, rect.Y + rect.Height - ar, ar, ar, 0, 90)path.AddArc(rect.X, rect.Y + rect.Height - ar, ar, ar, 90, 90)path.CloseFigure()g.FillPath(Brushes.White, path)MyBase.OnPaint(e)End SubSub 窗体圆角(form As Form, rgnRadius As Integer)Dim bs As GraphicsPath = New GraphicsPathbs.AddLine(rgnRadius, 0, Me.Width - rgnRadius * 2, 0)bs.AddArc(Me.Width - rgnRadius * 2, 0, rgnRadius * 2, rgnRadius * 2, 270, 90)bs.AddLine(Me.Width, rgnRadius, Me.Width, Me.Height - rgnRadius * 2)bs.AddArc(Me.Width - rgnRadius * 2, Me.Height - rgnRadius * 2, rgnRadius * 2, rgnRadius * 2, 0, 90)bs.AddLine(Me.Width - rgnRadius * 2, Me.Height, rgnRadius, Me.Height)bs.AddArc(0, Me.Height - rgnRadius * 2, rgnRadius * 2, rgnRadius * 2, 90, 90)bs.AddLine(0, Me.Height - rgnRadius * 2, 0, rgnRadius * 2)bs.AddArc(0, 0, rgnRadius * 2, rgnRadius * 2, 180, 90)bs.CloseFigure()Me.Region = New Region(bs)End SubEnd Class

最后尝试了使用WPF窗体,完美解决圆角问题

<Window x:Class="MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:工作助手WPF"mc:Ignorable="d"Title="MainWindow" Height="300" Width="200"WindowStyle="None"ResizeMode="NoResize"AllowsTransparency="True"Background="Transparent"><Grid SnapsToDevicePixels="True"><Border Background="White" BorderThickness="1" CornerRadius="10"><Button Content="Button" Margin="49,57,49,204"/></Border></Grid>
</Window>

 5.设置icon

 6.设置窗口初始位置,右下角

        Dim screenWidth As Integer = SystemParameters.PrimaryScreenWidthDim screenHeight As Integer = SystemParameters.PrimaryScreenHeightDim workHeight As Integer = SystemParameters.WorkArea.Height'MsgBox("--" & screenWidth & "--" & screenHeight & "--" & workHeight)Me.Left = screenWidth - Me.WidthMe.Top = workHeight - Me.Height

7.设置类似qq的吸附效果,这里附上完整代码

Imports System.Timers.Timer
Imports System.Windows.FormsClass MainWindow'Inherits WindowPublic Sub New()InitializeComponent()' 设置窗口的初始位置贴紧任务栏'Me.WindowStartupLocation = WindowStartupLocation.CenterScreen '显示在屏幕中心'Me.WindowStartupLocation = WindowStartupLocation.Manual '在指定位置显示Dim screenWidth As Integer = SystemParameters.PrimaryScreenWidthDim screenHeight As Integer = SystemParameters.PrimaryScreenHeightDim workHeight As Integer = SystemParameters.WorkArea.Height'MsgBox("--" & screenWidth & "--" & screenHeight & "--" & workHeight)Me.Left = screenWidth - Me.WidthMe.Top = workHeight - Me.HeightEnd Sub''' Protected Overrides Sub OnMouseLeftButtonDown(ByVal e As MouseButtonEventArgs) ' 拖动窗体MyBase.OnMouseLeftButtonDown(e)Me.DragMove()End SubPrivate hh As Boolean = FalsePrivate tt As Boolean = FalsePrivate timer As New TimerPrivate Sub MainWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loadedtimer.Enabled = TrueAddHandler timer.Tick, AddressOf timertickEnd SubPrivate Sub timertick()If hh = True ThenIf System.Windows.Forms.Cursor.Position.X >= clien()(0) - 5 And (System.Windows.Forms.Cursor.Position.Y >= Me.Top And System.Windows.Forms.Cursor.Position.Y <= Me.Top + Me.Height) ThenMe.Left = clien()(0) - Me.WidthEnd IfEnd IfIf tt = True ThenIf System.Windows.Forms.Cursor.Position.Y <= 1 And (System.Windows.Forms.Cursor.Position.X >= Me.Left And System.Windows.Forms.Cursor.Position.X <= Me.Left + Me.Width) ThenMe.Top = 1End IfEnd IfEnd SubPrivate Sub MainWindow_MouseEnter(sender As Object, e As System.Windows.Input.MouseEventArgs) Handles Me.MouseEnterIf hh = True ThenMe.Left = clien()(0) - Me.Widthhh = FalseEnd IfIf tt = True ThenMe.Top = 1tt = FalseEnd IfEnd SubFunction clien()Return {System.Windows.Forms.Screen.FromPoint(New System.Drawing.Point).Bounds.Width, System.Windows.Forms.Screen.FromPoint(New System.Drawing.Point).Bounds.Height}End FunctionPrivate Sub MainWindow_MouseLeave(sender As Object, e As System.Windows.Input.MouseEventArgs) Handles Me.MouseLeaveIf Me.Top <= 1 And Me.Left + Me.Width >= clien()(0) ThenMe.Top = -Me.Height + 5Me.Left = clien()(0) - Me.Widthtt = TrueElsehidden()shhtop()End IfEnd SubSub hidden()If Me.Left + Me.Width >= clien()(0) ThenMe.Left = clien()(0) - 5hh = TrueEnd IfEnd SubSub shhtop()If Me.Top <= 1 ThenMe.Top = -Me.Height + 5tt = TrueEnd IfEnd SubSub btn_upload_Click()End SubSub btn_close_Click()End Sub
End Class

问题一:其中System.Windows.Forms引用不到

解决方案

<UseWindowsForms>true</UseWindowsForms>

放置的位置是,【项目名】.csproj文件,在Visual Studio 2022 里双击项目名可以打开这个文件。

 <PropertyGroup><OutputType>WinExe</OutputType><TargetFramework>net6.0-windows</TargetFramework><Nullable>enable</Nullable><UseWPF>true</UseWPF><AssemblyVersion>1.0.1</AssemblyVersion><FileVersion>1.0.1.0</FileVersion><UseWindowsForms>true</UseWindowsForms></PropertyGroup>

 问题二:当鼠标停在屏幕顶部时,窗口会不停闪烁,因为窗口没有完全隐藏,鼠标反复进出窗口,所以将-Me.Height + 0,做成临界值,使窗口不再闪烁

问题三:由于电脑有缩放,导致对鼠标的位置判断有问题,有偏移,所以要先获取电脑缩放比

(System.Windows.Forms.Cursor.Position.X / 1.25 >= Me.Left And System.Windows.Forms.Cursor.Position.X / 1.25 <= Me.Left + Me.Width)

我的电脑缩放比试125%,所以这里要除以1.25

8.调试:Debug.WriteLine("hello")

3.打包exe

3.1.vs能生成exe,但是debug中的其他文件也要拷贝给客户才能运行,就是要复制一个文件包,对于小程序不方便。以下方法可以通过rar压缩软件制作exe文件,但是如果进行了最后一步,给压缩包自定义图标,在其他电脑上运行会报毒,但是不改图标,程序又是压缩包的图标,不够专业。所以本人不想使用此方式。

https://www.cnblogs.com/cmblogs/p/9782855.html

3.2打包成独立的exe,依据以下博客

VS 程序打包成一个独立的exe - Enigma Virtual Box-CSDN博客

3.3.vs2022生成单exe文件和不需安装.NET DESKTOP runtime 运行的方法

部署模式选独立,文件发布模式勾选生成单个文件,整个打包,不需要电脑安装.net。

如果用依赖框架的形式安装,点击程序运行时会自动跳转安装,也挺快的。

3.4之前能正常运行,重新打开后InitializeComponent()报错,解决办法,删除项目目录中obj文件夹,重新打开项目。

继续写的话就太长,留在下一节了。

最后附一下当前的成效吧,能自动吸附隐藏在上边框。

http://www.yayakq.cn/news/802184/

相关文章:

  • 网站建设有哪些知识点微网站建设使用程序
  • 企业网站要怎么做上海集团平台app
  • 企业网站建设该怎么描述深圳企业名录大全
  • 网站内容策略安卓做网站
  • 沈阳钢结构网架公司做网站如何网站考虑优化
  • 中英文网站用一个域名还是两个域名利于优化建设银行造价咨询中心网站
  • 一个免费的影视网站模板网站域名是不是网址
  • 杭州的互联网企业有哪些视频优化是什么意思
  • 郑州网站建设那家好下载做网站ftp具体步骤
  • 深圳做自适应网站设计网页设计师联盟官网
  • 网站如何绑定二级域名wordpress is single
  • 上海高端模板建站做网站推广的企业
  • 去生活服务性的网站做php好吗kj6699的seo综合查询
  • 网站开发模板系统wordpress cname
  • 利用第三方做网站永久发布地址电子商务平台内经营者享有公平交易的权利
  • 网站设计与网页制作岗位招聘信息物联网平台软件开发
  • 成都大丰网站建设例表网文化馆互联网站建设方案
  • 网站源码免费下载分享论坛给我一个网站好吗
  • 如何查看一个网站是否备案wordpress外链跳转
  • 招聘网站官网seo外链优化方法
  • vs2010做网站施坦威网站关于我们
  • 四平建设局网站火山视窗软件开发平台
  • wordpress开发复杂网站长沙最新招聘
  • 网站建设技术代码做网站需要的照片
  • 织梦网站更改怎么做网站的
  • 网站制作论文题目网页设计页面设计
  • 不锈钢网站建设哪家好网站开发不用jsp
  • 网站建设公式软件开发工具03173课后题
  • 帝国cms生成网站地图包装设计公司商业模式
  • 天津市建设工程交易中心网站深圳seo网站优化公司