Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3695556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:37:56+00:00 2026-05-19T04:37:56+00:00

Is there any way to embed a vb.net form to another vb.net form. What

  • 0

Is there any way to embed a vb.net form to another vb.net form. What I am trying to do is to make Form-A semi-transparent and Form-B as the embedded main form. So that the final application has a semi transparent border around it . Also I don’t want to use a MDI form.

Edit: How to make the border of a vb.net form semi-transparent without using MDI form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:37:56+00:00Added an answer on May 19, 2026 at 4:37 am

    I’ve simplified the code a bit and hooked up most of the events to a single method. There is no longer a Form-A, just a Form-B. Form-B now creates it’s own Form-A on the fly without any need to actually make a code file. I moved the border size to a variable so it would be easy to adjust it.

    Imports System.Runtime.InteropServices
    
    Public Class InnerForm
        Private borderSize As Integer = 10
        Private border As Form = New Form()
    
        Private Sub InnerForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            border.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            border.ShowInTaskbar = False
            border.BackColor = Color.Blue
            border.Opacity = 0.5
            border.Enabled = False
    
            RefreshBorder()
        End Sub
    
    Private Sub DrawRectangle()
        Dim p As New Drawing2D.GraphicsPath()
        p.StartFigure()
        p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
        p.AddLine(40, 0, border.Width - 40, 0)
        p.AddArc(New Rectangle(border.Width - 40, 0, 40, 40), -90, 90)
        p.AddLine(border.Width, 40, border.Width, border.Height - 40)
        p.AddArc(New Rectangle(border.Width - 40, border.Height - 40, 40, 40), 0, 90)
        p.AddLine(border.Width - 40, border.Height, 40, border.Height)
        p.AddArc(New Rectangle(0, border.Height - 40, 40, 40), 90, 90)
        p.CloseFigure()
        border.Region = New Region(p)
    End Sub
    
    Private Sub RefreshBorder()
        border.Show()
        border.Size = New Size(Me.Width + borderSize * 2, Me.Height + borderSize * 2)
        border.Location = New Point(Me.Location.X - borderSize, Me.Location.Y - borderSize)
        DrawRectangle()
        SetWindowPos(border.Handle, Me.Handle, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE)
    
        Me.BringToFront()
    End Sub
    
    
        Private Sub frmMAin_Refresh(ByVal sender As Object, ByVal e As System.EventArgs) _
            Handles Me.GotFocus, Me.Move, Me.Activated, Me.SizeChanged, MyBase.Shown
    
            'dont show when maximized or minimized, else show it'
            If Me.WindowState = FormWindowState.Maximized Or Me.WindowState = FormWindowState.Minimized Then
                border.Hide()
            Else
                RefreshBorder()
            End If
        End Sub
    
        <DllImport("user32.dll")> _
        Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Integer) As Boolean
        End Function
    
        Public Const SWP_NOSIZE As Int32 = &H1
        Public Const SWP_NOMOVE As Int32 = &H2
        Public Const SWP_NOACTIVATE As Int32 = &H10
    End Class
    

    Let me know if this works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to embed a widget in a data-bound DataGridViewCell when it
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any way to apply an attribute to a model file in ASP.NET
Is there any way to have something that looks just like a file on
Is there any way I can embed the images within my exe (as resource?)
Is there any way to check whether a file is locked without using a
Is there any way, in any language, to hook my program when a user
Is there any way to include the SVN repository revision number in the version
Is there any way to use inheritance in database (Specifically in SQL Server 2005)?
Is there any way to force a listview control to treat all clicks as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.