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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:55:02+00:00 2026-06-06T05:55:02+00:00

I have been set a project from school to design snake in VB.Net but

  • 0

I have been set a project from school to design snake in VB.Net but i am struggling to dynamically add the user control which acts as one of the dots in the body of the snake. Every time i add a dot on to the snake the previous vanishes. I assume this is due to me overwriting the previous one by creating a new instance of the object but i cannot find a way of adding a new one in.

    Dim body As New Dot
    Sub AddToSnake(ByVal i As Integer)
            'add 1 dot on to the back of the snake
            body.Location = New Point(50 + i, 50)
            body.Visible = True
            Me.Controls.Add(body)
         End Sub

I have tried using body(i) and other ways of adding a new instance of the object but am stuck.
The subroutine will be called up when a new control is needed.

  • 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-06-06T05:55:03+00:00Added an answer on June 6, 2026 at 5:55 am

    I assume this is due to me overwriting the previous one by creating a new instance of the object

    You aren’t actually creating a new instance anywhere, your code only ever creates a single instance of Dot and modifies the single instance’s location in AddToSnake. In order to overcome the problem, create a new instance of Dot inside AddToSnake.

    That said, user controls aren’t the correct way for this anyway. You should paint your snake body on a PictureBox control, and maintain the body as a a List(Of Point). Then you can simply add new points at the end of the list.

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

Sidebar

Related Questions

I have been trying to set AlarmManager for Specific date, but it is not
I have been tasked with building a new web project from scratch, with the
I have a .NETCF project that I have been trying to convert from .NETCF
I have been using WPF for a new project which is far from done.
I have a django project that I have been using for a while, but
I have many Java files from a project which have not been formatted properly.
Recently I have been looking into Cassandra from our new project's perspective and learned
I have been set a challenge to create an indexer that takes all words
trying to display data only after variables have been set. $(document).ready(function () { function
I have been trying to set up Eclipse and the Arduino libraries. I have

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.