winform MDI 窗口

wuxing2006 2006-07-21 01:01:56
怎么让MDI主窗口的背景改变啊。。就是背景图片 。。

...全文
439 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuxing2006 2006-07-24
  • 打赏
  • 举报
回复
好了。不知道怎么获取图片路径
wuxing2006 2006-07-24
  • 打赏
  • 举报
回复
没效
wuxing2006 2006-07-21
  • 打赏
  • 举报
回复
偶试试。如果可以。明天就加分。
jack6512006 2006-07-21
  • 打赏
  • 举报
回复
因为比较简单,我就不用C#写了
应该送分了吧
jack6512006 2006-07-21
  • 打赏
  • 举报
回复
这个是我的一个程序里面的
MDI窗口的背景 vb.net写的
'获取并绘制MDI窗口的背景图
Private Sub getmdipic()
Dim mycontrol As Control
Dim bgmdiclient As MdiClient
Dim myimage As Bitmap
Dim bgimage As Bitmap
'路径
Dim imgurl As String
Dim myGraphics As Graphics
'绘制方式
Dim drawtype As String

Try
drawtype = func.GetKeyVal(inipath, "BgImg", "showtype")
imgurl = Application.StartupPath & "\bgimg\" & func.GetKeyVal(inipath, "BgImg", "img")
For Each mycontrol In Me.Controls
If mycontrol.GetType.ToString = "System.Windows.Forms.MdiClient" Then
bgmdiclient = mycontrol
Exit For
End If
Next
bgimage = Bitmap.FromFile(imgurl)
Select Case drawtype
'平铺方式
Case "1"
myimage = New Bitmap(bgmdiclient.ClientSize.Width, bgmdiclient.ClientSize.Height)
myGraphics = Graphics.FromImage(myimage)
myGraphics.DrawImage(bgimage, 0, 0, myimage.Width + 1, myimage.Height + 1)
bgmdiclient.BackgroundImage = myimage
myGraphics.Dispose()
'拉伸方式
Case "2"
bgmdiclient.BackgroundImage = bgimage
Case Else
bgmdiclient.BackgroundImage = bgimage
End Select
Catch ex As Exception
Exit Sub
End Try
End Sub
jack6512006 2006-07-21
  • 打赏
  • 举报
回复
是不是说了就加分啊
yuzhlhua 2006-07-21
  • 打赏
  • 举报
回复
2005 有 BackgroundImage 属性的!
fellowcheng 2006-07-21
  • 打赏
  • 举报
回复
this.BackgroundImage = Image.FromFile("...");

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧