none
hide ide RRS feed

  • Question

  • When developing in Visual Basic net using the IDE how to hide the IDE when running a program.

    Just easier to see the program without the IDE showing behind.

    Have searched for answer but to no avail

    Thank you

    Wednesday, October 3, 2018 4:28 PM

All replies

  • Hi

    Close the IDE completely (or minimize it) then open either the Bin\Debug or Bin\Release folder and run the MyProject.exe. (where MyProject would be the name of the project).


    Regards Les, Livingston, Scotland



    • Edited by leshay Wednesday, October 3, 2018 4:43 PM
    Wednesday, October 3, 2018 4:42 PM
  • Visual Studio use to support macros and events that you could minimize the IDE but macros are not present in VS2013 and later.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, October 3, 2018 5:44 PM
    Moderator
  • Use this code:

        'Form Level Declarations
        Const SW_HIDE As Integer = 0
        Const SW_RESTORE As Integer = 1
        Const SW_MINIMIZE As Integer = 2
        Const SW_MAXIMIZE As Integer = 3
        Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
    
        Private Sub BtnMinimize_Click(sender As Object, e As EventArgs) Handles BtnMinimize.Click
            For Each p As Process In Process.GetProcesses
                Dim hWnd As Integer = CType(p.MainWindowHandle, Integer)
                If p.MainWindowTitle.Contains("Microsoft Visual Studio") Then
                    ShowWindow(hWnd, SW_MINIMIZE)
                    'Exit For '(optional) or Exit Sub
                End If
            Next p
        End Sub
    
    I would not leave it in the final product. The example is for a button click as you can see, it probably go in the Form_Load or Form_Shown event. 

    Saturday, October 6, 2018 2:21 AM