resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
Go Back  Xtreme Visual Basic Talk > > > resetting the locations of an array of picture boxes


Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2011, 01:32 AM
45minutes 45minutes is offline
Regular
 
Join Date: Jan 2011
Posts: 75
Default resetting the locations of an array of picture boxes


hi, I have created this code to reset my picture boxes to default locations upon form load.


my sub:

Code:
 Sub reset_Alien_locations()
        Dim Xlocation As Integer = 26

        For segmentIndex As Integer = 0 To AlienArray.Length - 114

            AlienArray(segmentIndex).Location = New Point(Xlocation, 49)

            Xlocation = Xlocation + 30
        Next segmentIndex
    End Sub
I have this sub load up upon form_load event. Yet it doesn't do a thing! I want each picture box to appear on the same row, hence the y axis is set to 49. but I want my X-axis to be added by 30, so that there is a gap of 30 pixels between each picture box, hence the x point is: Xlocation = Xlocation + 30

>< I wish I knew what was wrong, I'm having quite a few problems lately.
Reply With Quote
  #2  
Old 05-26-2011, 04:49 AM
PlausiblyDamp's Avatar
PlausiblyDampresetting the locations of an array of picture boxes PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Have you tried putting a breakpoint on the first line of the routine and stepping through it in a debugger? Problems are often easier to solve when using the tools available....

Also what are you expecting the line
Code:
   For segmentIndex As Integer = 0 To AlienArray.Length - 114
to be doing?

How many items are in the AlienArray? What is the result if you then take 114 away from this number?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 05-26-2011, 08:15 AM
AtmaWeapon's Avatar
AtmaWeaponresetting the locations of an array of picture boxes AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

You haven't described what is wrong. We can't fix a problem we can't understand.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
 
resetting the locations of an array of picture boxes
resetting the locations of an array of picture boxes
 
-->