Re: Multiple List Views ?
From: Jm (jarrodm_at_ihug.com.au)
Date: 12/31/04
- Next message: Gigi: "Re: update data row"
- Previous message: Jon Skeet [C# MVP]: "Re: Is there a way to enumerate classes(names in string format) from a class library? how to do it?"
- In reply to: Jm: "Re: Multiple List Views ?"
- Next in thread: Cor Ligthert: "Re: Multiple List Views ?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 31 Dec 2004 23:53:29 +1100
Hi Cor
Sorry about the quick posts just figured out the problem, because im using
the code inside a module i cant use Me for
SubLstView(SubLevelCount).Controls.Add(SubLstView(SubLevelCount))
so instead i used the form that i was referencing in the code
Console.Controls.Add(SubLstView(SubLevelCount))
Thanks for the link, wouldnt have figured it out without it. So many thanks
once again
"Jm" <jarrodm@ihug.com.au> wrote in message
news:cr3hls$11o$1@lust.ihug.co.nz...
> Little bit of extra info. I figured out the problem was me not reading the
> google message further so i added the sub to handle the event with blank
> code for the time being. But when the code gets to the point of adding the
> control it gives me this message:
>
> A circular control reference has been made. A control cannot be owned or
> parented to itself
>
> this is the extra code i added since last post
>
> Public Sub Sublstview_ItemActivate(ByVal sender As Object, ByVal e As
> System.EventArgs)
> Dim thisbutton As Button = DirectCast(sender, Button)
> MessageBox.Show("The day is: " & thisbutton.Text)
> End Sub
>
>
> "Jm" <jarrodm@ihug.com.au> wrote in message
> news:cr3gnt$fu$1@lust.ihug.co.nz...
> > Hi Cor
> >
> > Thanks for quick reply. I checked out the site you said and ive got most
> of
> > the idea of it i think. But im doing something wrong with the coding of
> the
> > events. This is the code im using, excluding all code around it for ease
> of
> > copy and paste
> >
> >
> > Public SubLevelCount As Integer
> > Public SubLstView() As ListView
> > Public SubImgLst() As ImageList
> > Public Console As New frmMain
> > ***
> >
> > ReDim Preserve SubLstView(SubLevelCount)
> > ReDim Preserve SubImgLst(SubLevelCount)
> > SubLstView(SubLevelCount) = New ListView
> > SubImgLst(SubLevelCount) = New ImageList
> > SubImgLst(SubLevelCount).ImageSize = New Size(32, 32)
> > SubImgLst(SubLevelCount).Images.Add(Console.imgLstMain.Images(1))
> > SubLstView(SubLevelCount).Left = 8
> > SubLstView(SubLevelCount).Top = 32
> > SubLstView(SubLevelCount).Width = 560
> > SubLstView(SubLevelCount).Height = 224
> > SubLstView(SubLevelCount).BackColor = Drawing.Color.FromArgb(58, 110,
165)
> > SubLstView(SubLevelCount).ForeColor = System.Drawing.Color.White
> > SubLstView(SubLevelCount).MultiSelect = False
> > SubLstView(SubLevelCount).Parent = Console
> > SubLstView(SubLevelCount).Sorting = SortOrder.Ascending
> > SubLstView(SubLevelCount).SmallImageList = SubImgLst(SubLevelCount)
> > SubLstView(SubLevelCount).LargeImageList = SubImgLst(SubLevelCount)
> >
> > Now heres where i wasnt sure how to go
> >
> > SubLstView(SubLevelCount).Controls.Add(SubLstView(SubLevelCount))
> > AddHandler SubLstView(SubLevelCount).ItemActivate, AddressOf
> > SubLstView_ItemActivate
> >
> >
> > The addhandler line confused me. I wanted to add a handler for the item
> > activate event. So when a user double clicks i can run the necessary
code.
> I
> > tried to adapt it to my code but at the end for the AddressOf part it
> seems
> > to fail and im not sure what to do from here ? Any Ideas ?
> >
> > Thanks
> >
> > "Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
> > news:#P7ypzy7EHA.824@TK2MSFTNGP11.phx.gbl...
> > > JM,
> > >
> > > Hefried mentioned the add and the use of the handlers however gave no
> > code,
> > > you can see this sample l although it is about buttons.
> > >
> > > In this message is that sample from me of that.
> > >
> >
>
http://groups-beta.google.com/group/microsoft.public.dotnet.languages.vb/msg/4cead7b143e32591
> > >
> > > I hope this helps?
> > >
> > > Cor
> > >
> > >
> > >
> >
> >
>
>
- Next message: Gigi: "Re: update data row"
- Previous message: Jon Skeet [C# MVP]: "Re: Is there a way to enumerate classes(names in string format) from a class library? how to do it?"
- In reply to: Jm: "Re: Multiple List Views ?"
- Next in thread: Cor Ligthert: "Re: Multiple List Views ?"
- Messages sorted by: [ date ] [ thread ]