Click here to Skip to main content
15,912,665 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionSimple custom control repaint problem Pin
TheRedEye10-Dec-08 22:05
TheRedEye10-Dec-08 22:05 
AnswerRe: Simple custom control repaint problem Pin
Dave Kreskowiak11-Dec-08 2:04
mveDave Kreskowiak11-Dec-08 2:04 
GeneralRe: Simple custom control repaint problem Pin
TheRedEye11-Dec-08 4:05
TheRedEye11-Dec-08 4:05 
GeneralRe: Simple custom control repaint problem Pin
Dave Kreskowiak11-Dec-08 4:42
mveDave Kreskowiak11-Dec-08 4:42 
Questionhow to change language dependent datetime picker dynamically in .net window forms Pin
arunmca.r10-Dec-08 21:43
arunmca.r10-Dec-08 21:43 
AnswerRe: how to change language dependent datetime picker dynamically in .net window forms Pin
Mycroft Holmes11-Dec-08 20:37
professionalMycroft Holmes11-Dec-08 20:37 
GeneralRe: how to change language dependent datetime picker dynamically in .net window forms Pin
arunmca.r14-Dec-08 17:31
arunmca.r14-Dec-08 17:31 
Questionarraylist problem Pin
bapu288910-Dec-08 9:12
bapu288910-Dec-08 9:12 
Hello

This is one exercise in OOP lesson ,but still I am bit confuse how to get rid of small widgets, and what I want to do is when form loads it displays small widgets(<= 20) in one listbox and and rest in second listox, any help, In Public Function GetRidOfTheSmallWidgets I have put loop but it's only displays 0,1,2 so how can i add small widgets in one listbox and big ones in second listbox

Imports System.Collections.Generic
Imports System.Text
Imports System.Collections

Public Class Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        Dim colBoxesOfWidgets As New ArrayList()
        colBoxesOfWidgets.Add(New BoxOfWidgets("Cardboard"))
        DirectCast(colBoxesOfWidgets(0), BoxOfWidgets).colWidgets.Add(New Widget("The Blue Widget", 12))
        DirectCast(colBoxesOfWidgets(0), BoxOfWidgets).colWidgets.Add(New Widget("The Red Widget", 15))
        DirectCast(colBoxesOfWidgets(0), BoxOfWidgets).colWidgets.Add(New Widget("The Silver Widget", 6))
        DirectCast(colBoxesOfWidgets(0), BoxOfWidgets).colWidgets.Add(New Widget("The Green Widget", 52))

        colBoxesOfWidgets.Add(New BoxOfWidgets("Metal"))
        DirectCast(colBoxesOfWidgets(1), BoxOfWidgets).colWidgets.Add(New Widget("The Gold Widget", 9))
        DirectCast(colBoxesOfWidgets(1), BoxOfWidgets).colWidgets.Add(New Widget("The Orange Widget", 115))
        DirectCast(colBoxesOfWidgets(1), BoxOfWidgets).colWidgets.Add(New Widget("The Pink Widget", 1))

        colBoxesOfWidgets.Add(New BoxOfWidgets("Metel"))
        DirectCast(colBoxesOfWidgets(2), BoxOfWidgets).colWidgets.Add(New Widget("The Grey Widget", 12))
        DirectCast(colBoxesOfWidgets(2), BoxOfWidgets).colWidgets.Add(New Widget("The Black Widget", 15))
        DirectCast(colBoxesOfWidgets(2), BoxOfWidgets).colWidgets.Add(New Widget("The White Widget", 19))
        DirectCast(colBoxesOfWidgets(2), BoxOfWidgets).colWidgets.Add(New Widget("The Brown Widget", 60))
        DirectCast(colBoxesOfWidgets(2), BoxOfWidgets).colWidgets.Add(New Widget("The Peach Widget", 16))

        Call GetRidOfTheSmallWidgets(colBoxesOfWidgets)



    End Sub

    Public Function GetRidOfTheSmallWidgets(ByVal colBoxesOfWidgets As ArrayList) As ArrayList

       For I As Integer = 0 To colBoxesOfWidgets.Count - 1

            lstWidgets.Items.Add(I).ToString()

        Next
        Return (colBoxesOfWidgets)

    End Function

End Class

Class BoxOfWidgets
    Public boxType As String
    Public colWidgets As ArrayList

    Public Sub New(ByVal newBoxType As String)
        boxType = newBoxType
        colWidgets = New ArrayList()
    End Sub
End Class

Class Widget
    Public name As String
    Public length As Single

    Public Sub New(ByVal newName As String, ByVal newLength As Single)
        Me.name = newName
        Me.length = newLength
    End Sub
End Class

AnswerRe: arraylist problem Pin
Ben Fair10-Dec-08 10:05
Ben Fair10-Dec-08 10:05 
QuestionRe: arraylist problem Pin
bapu288910-Dec-08 19:57
bapu288910-Dec-08 19:57 
AnswerRe: arraylist problem Pin
Ben Fair11-Dec-08 3:13
Ben Fair11-Dec-08 3:13 
QuestionRe: arraylist problem Pin
bapu288911-Dec-08 9:43
bapu288911-Dec-08 9:43 
QuestionAccessing ListBox from multiple threads Pin
Mr.Brainley8-Dec-08 5:39
Mr.Brainley8-Dec-08 5:39 
AnswerRe: Accessing ListBox from multiple threads Pin
Giorgi Dalakishvili8-Dec-08 6:01
mentorGiorgi Dalakishvili8-Dec-08 6:01 
GeneralRe: Accessing ListBox from multiple threads Pin
Mr.Brainley8-Dec-08 6:12
Mr.Brainley8-Dec-08 6:12 
GeneralRe: Accessing ListBox from multiple threads Pin
Giorgi Dalakishvili8-Dec-08 6:28
mentorGiorgi Dalakishvili8-Dec-08 6:28 
AnswerRe: Accessing ListBox from multiple threads Pin
Fadi Yoosuf13-Dec-08 3:03
Fadi Yoosuf13-Dec-08 3:03 
QuestionPanel OnPaint Help [modified] Pin
Zippy Pack7-Dec-08 8:45
Zippy Pack7-Dec-08 8:45 
AnswerRe: Panel OnPaint Help Pin
Ben Fair10-Dec-08 9:54
Ben Fair10-Dec-08 9:54 
QuestionMacros in XP Pin
awiltz5-Dec-08 11:07
awiltz5-Dec-08 11:07 
AnswerRe: Macros in XP Pin
Dave Kreskowiak5-Dec-08 11:53
mveDave Kreskowiak5-Dec-08 11:53 
Questiondata reader Pin
gogo6114-Dec-08 12:57
gogo6114-Dec-08 12:57 
AnswerRe: data reader Pin
Roger Wright4-Dec-08 15:29
professionalRoger Wright4-Dec-08 15:29 
AnswerRe: data reader Pin
Wendelius5-Dec-08 9:32
mentorWendelius5-Dec-08 9:32 
QuestionDynamic Filling of Autocomplete TextBox Pin
SelvaSR3-Dec-08 0:44
SelvaSR3-Dec-08 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.