您的位置:程序门 -> .net技术 -> vb.net



关于窗体的虚线框


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


关于窗体的虚线框
发表于:2007-08-13 14:35:22 楼主
代码如下,运行后窗体的虚线框没有随着一起变大,留在那还是
个小框,怎么解决
各位帮忙啦,谢!!

public   class   form1
        private   host   as   idesignerhost
        private   root   as   form
        private   sub   form1_load(byval   sender   as   system.object,   byval   e   as   system.eventargs)   handles   mybase.load
                dim   surface   as   new   designsurface
                surface.beginload(gettype(form))

                host   =   (ctype(surface.getservice(gettype(idesignerhost)),   idesignerhost))
                root   =   host.rootcomponent
                dim   x   as   short   =   screen.primaryscreen.bounds.width
                dim   y   as   short   =   screen.primaryscreen.bounds.height
                root.size   =   new   size(x,   y)

                dim   view   as   control   =   surface.view
                view.dock   =   dockstyle.fill
                view.invalidate()
                me.controls.add(view)

        end   sub

end   class
发表于:2007-08-13 14:36:541楼 得分:0
up
发表于:2007-08-13 17:12:352楼 得分:0
写在load里只会调用一次,所以不会刷新,看看有没有paint之类的地方可以写。
发表于:2007-08-13 19:32:303楼 得分:0
在form1_resize里写虚线筐的代码
发表于:2007-08-14 08:28:354楼 得分:0
必须要在paint事件内写的,否则怎么会跟着变化??

==================================================================
博客空间:http://blog.csdn.net/lovingkiss
资源下载:http://download.csdn.net/user/lovingkiss
优惠接单开发,组件控件定制开发,成品源代码批发
联系方式:q64180940   全天在线
==================================================================
发表于:2007-08-14 10:46:365楼 得分:0
在下边加入这两句话:
root.dock   =   dockstyle.top
root.dock   =   dockstyle.none

具体代码如下:
public   class   form1
        private   host   as   idesignerhost
        private   root   as   form
        private   sub   form1_load(byval   sender   as   system.object,   byval   e   as   system.eventargs)   handles   mybase.load
                dim   surface   as   new   designsurface
                surface.beginload(gettype(form))

                host   =   (ctype(surface.getservice(gettype(idesignerhost)),   idesignerhost))
                root   =   host.rootcomponent
                dim   x   as   short   =   screen.primaryscreen.bounds.width
                dim   y   as   short   =   screen.primaryscreen.bounds.height
                root.size   =   new   size(x,   y)
                ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  
                '加这
                root.dock   =   dockstyle.top
                root.dock   =   dockstyle.none
                ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
                dim   view   as   control   =   surface.view
                view.dock   =   dockstyle.fill
                view.invalidate()
                me.controls.add(view)

        end   sub

end   class


快速检索

最新资讯
热门点击