vb.net 控制台程序转化为窗体退出 窗体还在

c#控制台应用程序,如何实现隐藏DOS窗口?-.NET技术/.NETFramework-asp.net-电脑编程网c#控制台应用程序,如何实现隐藏DOS窗口?-.NET技术/.NETFramework作者:canyangruxie 和相关&&c#控制台应用程序,如何不显示DOS窗口?大家都知道,控制台应用程序在运行的时候,会出现DOS窗口,这样给用户的感觉不友好,怎样隐藏DOS窗口?------回答---------------其他回答(10分)---------转用 Window form 吧, 它两本质上是一致的------其他回答(5分)---------那是,用WinForm就可以设置hide了。------其他回答(5分)---------Windows Service相关资料:|||||||c#控制台应用程序,如何实现隐藏DOS窗口?-.NET技术/.NETFramework来源网络,如有侵权请告知,即处理!编程Tags:                &                    温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
方案一:网上最常见的解决方案是,在程序结尾的return 0;之前加system("pause")或getchar(),或者断点等等让程序停顿。方案二:从微软的论坛上得到了另一种解决方法,如下。出现这种原因,主要是建立工程时选用的是“空工程(Empty Project)”,而不是“Win32控制台程序(Win32 console application)”。解决的方法是:将工程属性(properties)& "configuration properties" & "linker" & "system"中的"subsystem"&项改为“Console (/SUBSYSTEM:CONSOLE)”改正完之后,重新使用Ctrl+F5运行程序,问题已经解决,让人喜欢的"press any key to continue..." (“请按任意键继续”)又回来了!!!————————————————————————————————————————————————————原文为:Q:Missing "press any key to continue..." when lauching with CTRL+F5&A:Linked to this from Google and I think I have the answer and an easier workaround. This is not for the original poster, but for future Googlers like me. With the new visual studio 2010 you might see this behavior even when you use ctrl f5 aka "start without debugging". This is most likely because you created an "empty project" instead of a "Win32 console application". If you create the project as a "Win32 console application" you can disregard this as it does not apply. In the older versions it would default to the console subsystem even if you selected "empty project", but not in 2010, so you have to set it manually. To do this select the project in the solution explorer on the right or left (probably is already selected so you don't have to worry about this). Then select "project" from the menu bar drop down menus, then select "*project_name* properties" & "configuration properties" & "linker" & "system" and set the first property, the drop down "subsystem" property to "console (/SUBSYSTEM:CONSOLE)". The console window should now stay open after execution as usual.
阅读(4843)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'VS中运行后控制台窗口一闪就没了',
blogAbstract:'Q:使用VS2010后,用Ctrl+F5运行程序,结果控制台窗口一闪就没了,也没有出现\"press any key to continue...\" 或者“请按任意键继续”。A:方案一:网上最常见的解决方案是,在程序结尾的return 0;之前加system(\"pause\")或getchar(),或者断点等等让程序停顿。方案二:从微软的论坛上得到了另一种解决方法,如下。出现这种原因,主要是建立工程时选用的是“空工程(Empty Project)”,而不是“Win32控制台程序(Win32 console application)”。',
blogTag:'console',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:2,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}vb.net教程之禁用窗体的关闭按钮
来源:未知
禁用窗体的关闭按钮
Public Class Form1
&&& Private Declare Function GetSystemMenu Lib &User32& (ByVal hwnd As Integer, ByVal bRevert As Integer) As Integer
&&& Private Declare Function RemoveMenu Lib &User32& (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
&&& Private Declare Function DrawMenuBar Lib &User32& (ByVal hwnd As Integer) As Integer
&&& Private Declare Function GetMenuItemCount Lib &User32& (ByVal hMenu As Integer) As Integer
&&& Private Const MF_BYPOSITION = &H400&
&&& Private Const MF_DISABLED = &H2&
&&& Private Sub disableX(ByVal wnd As Form)
&&&&&&& Dim hMenu As Integer, nCount As Integer
&&&&&&& '得到系统Menu
&&&&&&& hMenu = GetSystemMenu(wnd.Handle.ToInt32, 0)
&&&&&&& '得到系统Menu的个数
&&&&&&& nCount = GetMenuItemCount(hMenu)
&&&&&&& '去除系统Menu
&&&&&&& Call RemoveMenu(hMenu, nCount - 1, MF_BYPOSITION Or MF_DISABLED)
&&&&&&& '重画MenuBar
&&&&&&& DrawMenuBar(Me.Handle.ToInt32)
&&& End Sub
&&& Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
&&&&&&& disableX(Me)& '屏蔽关闭按钮
&&& End Sub
&&& Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
&&&&&&& Me.MaximizeBox = False '屏蔽最大化按钮
&&& End Sub
&&& Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
&&&&&&& Me.MinimizeBox = False '屏蔽最小化按钮
&&& End Sub
-----------第一个VB.NET控制台应用程序——欢迎信息显示
我的图书馆
第一个VB.NET控制台应用程序——欢迎信息显示
图文讲解简要步骤:打开 控制台应用程序控制台应用程序模板在Sub Main()过程中编写如下程序代码:& & Sub Main()& && &&&Dim XM As String&&'定义存放入姓名的变量XM& && &&&Dim XB As String& && &&&Console.Write("请输入您的姓名:")& && &&&XM = Console.ReadLine() '输入人的姓名& && &&&Console.Write("请输入您的性别:") '输出提示信息& && &&&XB = Console.ReadLine() '读入人的性别& && &&&If XB = "男" Then& && && && &REM& && && && &Console.WriteLine("欢迎您,先生!", XM)& && &&&Else& && && && &REM& && && && &Console.WriteLine("欢迎您,女士", XM)& && &&&End If& && &&&Console.Read() REM& & End Sub效果图:
发表评论:
TA的推荐TA的最新馆藏[转]&[转]&

我要回帖

更多关于 c 控制台程序退出 的文章

 

随机推荐