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 6216367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:14:24+00:00 2026-05-24T07:14:24+00:00

I created a rectangle shape and tried to show it at my form like

  • 0

I created a rectangle shape and tried to show it at my form like this

Imports Microsoft.VisualBasic.PowerPacks
Public Class frmBoard

    Dim baseDice As RectangleShape

    Private Sub frmBoard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        baseDice.CornerRadius = 5
        baseDice.Height = 50
        baseDice.Width = 50
        baseDice.BackColor = Color.Blue

        Me.components.Add(baseDice)

    End Sub
End Class

This didn’t work. I missed something, but I dont know what…

Updated Code, after @Jay Riggs answer

Imports Microsoft.VisualBasic.PowerPacks
Public Class frmBoard

    Dim baseDice As RectangleShape
    Dim shapeContainer As ShapeContainer

    Private Sub frmBoard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        shapeContainer.Parent = Me
        baseDice.Parent = shapeContainer
        baseDice.CornerRadius = 5
        baseDice.Height = 50
        baseDice.Width = 50
        baseDice.BackColor = Color.Blue
        baseDice.Left = 50
        baseDice.Top = 50
        'Me.components.Add(baseDice)



    End Sub
End Class

This also didn’t work

  • 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-24T07:14:25+00:00Added an answer on May 24, 2026 at 7:14 am

    The MSDN documentation for the RectangleShape Class demonstrates what you need to do: set the RectangleShape‘s Left and Top properties.

    Private Sub DrawRectangle()
        Dim canvas As New Microsoft.VisualBasic.PowerPacks.ShapeContainer
        Dim rect1 As New Microsoft.VisualBasic.PowerPacks.RectangleShape
        ' Set the form as the parent of the ShapeContainer.
        canvas.Parent = Me
        ' Set the ShapeContainer as the parent of the RectangleShape.
        rect1.Parent = canvas
        ' Set the location and size of the rectangle.
        rect1.Left = 10
        rect1.Top = 10
        rect1.Width = 300
        rect1.Height = 100
    End Sub
    

    EDIT
    Update your code to instantiate your ShapeContainer and RectangleShape objects:

    Dim baseDice As RectangleShape = New RectangleShape
    Dim shapeContainer As ShapeContainer = New ShapeContainer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to create rectangle like this, in xml with shape but no
I created three classes: Shape (base class) , Rectangle and Square . I tried
I'v created this class here: //Integer rectangle class class AguiRectangle { int x; int
I have a rectangle that I've created and set its individual properties like so
Just out of curiosity, I wanted to do this and created some shapes like
I have some shapes created by class Rectangle and I want to surround them
I need to create a rectangle bubble with rounded corners with text inside, like
I have created a custom shape, essentially it is a collection of four Arc2D
I created a bufferedimage which i applied to a Rectangle to use as filling
I have a movieclip wich has a simple movement of a simple shape. This

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.