Foxtable(狐表)用户栏目专家坐堂 → 用GDI+ 写的窗口UI 怎么老是这样 重复的!


  共有3637人关注过本帖树形打印复制链接

主题:用GDI+ 写的窗口UI 怎么老是这样 重复的!

帅哥哟,离线,有人找我吗?
jianjingmaoyi
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
用GDI+ 写的窗口UI 怎么老是这样 重复的!  发帖心情 Post By:2014/7/25 23:04:00 [显示全部帖子]

用GDI+ 写的窗口UI 怎么老是这样 重复的!  我已经在窗口大小的事件中放入同样的代码了 还是这样:


图片点击可在新窗口打开查看此主题相关图片如下:_gi8e0p3w484u$vks2`@5aj.jpg
图片点击可在新窗口打开查看


代码如下:


'e.Form.Controls("TextBox1").BackColor = system.Drawing.Color.Transparent
'DataTables("表C").SysStyles("Alternate").BackColor = SystemColors.Highlight


'-------------------窗口圆角-------------------------------------------------------------
'e.form.BaseForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None   '
'e.Form.BaseForm.ControlBox =  False
'e.Form.BaseForm.showintaskbar = True
'Dim r1 As Integer = CreateRoundRectRgn(0, 0, e.Form.Width-1, e.Form.Height, 10, 10)
'SetWindowRgn(e.Form.BaseForm.Handle, r1, 0)
'----------------------标题----------------------------------------------------------
e.Form.StopRedraw
Dim clr As Color = SystemColors.GradientInactiveCaption
e.Form.BackColor = Clr
Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim g As Graphics = p.Graphics
Dim Rectangle As New Rectangle(0,0,p.Width,p.Height)
Dim Mybrush As New LinearGradientBrush(Rectangle,clr,Color.White,LinearGradientMode.Vertical)  '窗口渐变色
'g.FillRectangle(Mybrush,e.form.baseform.ClientRectangle)   '窗口渐变色
g.FillRectangle(Mybrush,Rectangle)   '窗口渐变色

Dim fnt1 As New Font("微软雅黑",18,FontStyle.Italic)
'Dim fnt1 As New Font("微软雅黑",26,FontStyle.bold)
Dim msg1 As String = "数据库营销系统"
g.DrawString(msg1,fnt1,Brushes.Teal,88,5)
'
Dim fnt2 As New Font("Vladimir Script",20)
Dim msg2 As String = "Database marketing system"
g.DrawString(msg2,fnt2,Brushes.Navy,71,37)
g.DrawString(msg2,fnt2,Brushes.SkyBlue,72,38)
If filesys.FileExists(projectpath & "images\图标1.png")
    g.DrawImage(getImage("图标1.png"),5,2,72,72)
End If
Dim myslog As String ="当前登录:" & _UserName & "  今日为: " & Format(Date.Today,"D") & "  " &  Format(Date.Today,"dddd")
Dim fnt_2 As New Font("微软雅黑",9)
Dim MySize As SizeF = g.MeasureString(myslog,fnt_2)
g.DrawString(myslog,fnt_2,Brushes.red,p.Width - MySize.Width -5,38)
p.Repaint()
e.Form.ResumeRedraw


'Dim br1 As Brush = New SolidBrush(Color.LightSteelBlue)
'g.FillRectangle(br1,40,114,e.Form.Width-80 ,190)
'Dim br2 As Brush = New SolidBrush(clr)
'g.FillRectangle(br2,36,110,e.Form.Width-80 ,190)
'Dim n As New Pen(Color.DodgerBlue,1)
'g.DrawRectangle(n,36,110,e.Form.Width-80 ,190)
'Dim Up As Color = Color.White
'Dim Down As Color = Color.white
'Dim Size As SizeF = g.MeasureString(msg1, Fnt1)
'Dim Point As New PointF(5,5)  '设置文字的显示位置
'Dim Point0 As New PointF(5,5)  '设置文字的显示位置
'Dim Rect As New RectangleF(Point, Size)   '根据文字的大小及位置,实例化RectangleF类
'Dim LinearBrush As New LinearGradientBrush(Rect, Up, Down, LinearGradientMode.Horizontal)  '设置从左到右的线性渐变效果
'g.DrawString(msg1, Fnt1, Brushes.Gray, Point0)
'g.DrawString(msg1, Fnt1, LinearBrush, Point)


'-------------------第二段---------------------------
'Dim fnt_1 As New Font("微软雅黑",20)           'FontStyle.Italic)
'Dim fnt1 As New Font("微软雅黑",26,FontStyle.bold)
'Dim msg_1 As String = "企业信息管理系统"




'Dim Up_1 As Color = Color.Teal
'Dim Down_1 As Color = Color.Teal
'Dim Size_1 As SizeF = g.MeasureString(msg_1, Fnt_1)
'Dim Point_1 As New PointF(5,5)  '设置文字的显示位置
'Dim Point0_1 As New PointF(5,5)  '设置文字的显示位置
'Dim Rect_1 As New RectangleF(Point_1, Size_1)   '根据文字的大小及位置,实例化RectangleF类
'Dim LinearBrush_1 As New LinearGradientBrush(Rect_1, Up_1, Down_1, LinearGradientMode.Horizontal)  '设置从左到右的线性渐变效果
'g.DrawString(msg_1, Fnt_1, Brushes.Gray, Point0_1)
'g.DrawString(msg_1, Fnt_1, LinearBrush, Point_1)

'---------------------画线--------------------------------
'Dim pn As New Pen(Color.White,3)
'g.DrawLine(pn,36,65,400,65)
''----------------英文----------------------


''-----------------------画框---------------------------------



 回到顶部
帅哥哟,离线,有人找我吗?
jianjingmaoyi
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
  发帖心情 Post By:2014/7/25 23:19:00 [显示全部帖子]

==

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:excel图表.table



图片点击可在新窗口打开查看此主题相关图片如下:图标1.png
图片点击可在新窗口打开查看


 回到顶部
帅哥哟,离线,有人找我吗?
jianjingmaoyi
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
  发帖心情 Post By:2014/7/25 23:30:00 [显示全部帖子]

但是窗口大小我也重写了代码了呀

 回到顶部