Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paul Roseby

@Paul Roseby
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • game programming in vb.net
    P Paul Roseby

    This sound to me very similar to a shipping logic problem. The below is defiantly not the answer but it is a start.

        Dim shapeArray(3, 2) As Integer
        Dim containerWidth As Integer = 11
        Dim containerHeight As Integer = 7
    
        shapeArray(0, 0) = 5
        shapeArray(0, 1) = 5
    
        shapeArray(1, 0) = 2
        shapeArray(1, 1) = 5
    
        shapeArray(2, 0) = 1
        shapeArray(2, 1) = 1
    
        shapeArray(3, 0) = 5
        shapeArray(3, 1) = 6
    
        Dim totalArea As Integer = 0
        For i As Integer = 0 To UBound(shapeArray)
            totalArea += (shapeArray(i, 0) \* shapeArray(i, 1))
        Next
    
        If totalArea > (containerWidth \* containerHeight) Then
            MsgBox("Shapes are unable to fit into container")
            Exit Sub
        End If
    

    The above code basically checks to see if all the shapes will fit into the container/main box. You will perhaps need to sort the array into longest sides, then position the largest sized shapes into the box first. Also take into consideration that some of the shapes could potentially be rotated. Might be worth looking into logic/calculations for packing boxes as well as games development, Id be very interested to know if you find some good samples. Hope this helps.

    Visual Basic csharp css game-dev docker

  • Can not set the name property of a timer at runtime - VB.NET
    P Paul Roseby

    Also might I add, from experience you might want to monitor how much memory your application uses after 1 hour of your software running then 2.... Just in case there are any memory leaks. Hope this helps

    Visual Basic help csharp database graphics

  • Can not set the name property of a timer at runtime - VB.NET
    P Paul Roseby

    Im not quite sure I understand why it is you needed alot of timers, as im sure there would be a better way to do it. I would have thought that you could just use Threads.

    Dim t As New Threading.Thread(AddressOf myThread)

    Private Sub btnStart\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        t.Start()
    End Sub
    
    Private Sub myThread()
        Do
            'Work to be done
            '....
    
            ' Waits 5 seconds before next iteration
            Threading.Thread.Sleep(New TimeSpan(0, 0, 5))
            'Or for miliseconds use this: Threading.Thread.Sleep(500)
        Loop
    End Sub
    

    The myThread method will continue running until either you run a t.stop() from somewhere else in your code or you call an "Exit Loop" from within the Do Loop. Please Note: If you are updating controls on a form from a threaded function you will need to use a Delegate, I can send you an example if you cannot find one. Also if you have a number of threads accessing the same resources you might need to use a Mutex to limit access violations. Hope this helps.

    Visual Basic help csharp database graphics
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups