|
hi every body,
how to display categories by tree view
i am read my data from database (acesss)
my table is :
filds:
CategoryId - Root - CategoryName
1 0 country
2 1 city
3 2 school
4 3 class 102
5 4 Chair
6 5 leg
thank you very match before your ansewer .
please hury up ... help
|
|
|
|
|
miladbiranvand wrote: please hury up
NO !!!!!
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
|
I have a table in the following format and I want to create a form with a tree view control to display the data to the end user.
All the rows with LeafCategory is 0 have children. Leaf category 1 means its last category. i.e not expandable.
In the following example category id 20081 is the Main category. A category is considered main category when the CategoryID and CategoryParentId are same.
CategoryId 's 37903 and 4707 are children of 20081. 37909, 63516, 37911 are childen of 4707... etc.
I don't want to write a sql statmet for each node to find out the childen. I'm looking for a solution with arrays, hash table .. etc. VB.NET
CategoryId CategoryLevel CategoryName CategoryParentId LeafCategory
----------- ------------- -------------------------------------------------- ---------------- ------------
20081 1 Antiques 20081 0
37903 2 Antiquities (Classical, Amer.) 20081 0
4707 2 Architectural & Garden 20081 0
37909 3 Ceiling Tins 4707 1
63516 3 Chandeliers, Fixtures, Sconces 4707 1
37911 3 Hardware 4707 0
37912 4 Door Bells, Knockers 37911 1
37913 4 Hooks & Brackets 37911 1
37914 4 Knobs & Handles 37911 1
|
|
|
|
|
pleass this see
but in vb.net
|
|
|
|
|
Better be quick, your assignment for school must be due on Monday is it?
FAIL
|
|
|
|
|
|
please help!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
If you want help you are going about it the wrong way.
READ THE POSTS AT THE TOP OF THE FORUM - They are easy to understand!
|
|
|
|
|
|
|
|
miladbiranvand wrote: ok ,now help
Ha, I almost gave a 5 to this for the amount of LOL.
|
|
|
|
|
I have a form with many image controls on it (which can be added during runtime, so the total number changes at random each time the app is run). I need to trap a mousedown event when the mouse is over one of the image controls (any one of them, again, at random).
As I am adding images during runtime, I cannot use a standard object.mousedown event trap as I do not know how many image controls there may be in total - and therefore cannot have a separate subroutine for each and every control.
Is there a way of trapping a mousedown anywhere/anytime, even when it is over ANY control of the form, and when detected then identify the control that the mouse is over at the time? (i.e. return the forms identity during the mousedown event)
I have rowsed the web and looked around, but cannot find a way to trap a mousedown without first having a object.mousedown subroutine for each and every control identity..............any ideas greatly appreciated!
|
|
|
|
|
As you dynamically add your picture boxes to your form, attach a event handler delegate to the object that is shared by all the picture boxes;
In the example below, a button keeps adding new picture boxes to the form, as you mouse over them the label will change to show the new name. You can add other handlers in the same way to capture when you leave the picture box etc.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Counter for the new object name
Static counter As Integer
counter += 1
'Add a picture box
Dim newPicBox As New PictureBox
newPicBox.Name = "Custom Box " + counter.ToString
AddHandler newPicBox.MouseMove, AddressOf customMouseMove
'Add it to the forms collection
Me.Controls.Add(newPicBox)
'Set it up
newPicBox.BackColor = Color.AliceBlue
newPicBox.Top = 25
newPicBox.Left = 50
newPicBox.Width = 100
newPicBox.Height = 100
newPicBox.BringToFront()
End Sub
Private Sub customMouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim picBox As PictureBox = sender
Label1.Text = "Over: " & picBox.Name
End Sub
|
|
|
|
|
I am afraid I am not that good a VB writer (yet).
What is the event handler delegate I need to use, I presume this goes at the start of the form's code (i.e. top of the page?)
Also, I think your line "counter +=1" has an error? and my VB6 doesnt like your line "newPicBox.BringToFront()"
I have a lot of fun experimenting with (and slowly learning) VB, but I havn't delved or learnt writing event handlers yet.
Perhaps you could add the necessary line(s) to your example - so I can copy, adapt, and learn from it along the way?
Many thanks for the very prompt and helpful response, sorry I don't have the experience to make the most of your assistance!!
|
|
|
|
|
How the hell was i supposed to know you are using a dead language! it doesn't say that in your original post.
You need to be specific. I think it is time you moved on to .Net, go grab the free version from MS website and start learning that. If you are starting out, don't entertain vb6, you are wasting your time, go straight to .Net or you will get a shock when you move to .net
Yes it will throw errors, because it is written in .Net
So, how do you do it in VB6, can't remember/don't know, and not going to even try and find out.
|
|
|
|
|
Actually, I have been a VB'er from way back, writing small home-brew apps in VB4, then 5 then 6..........at my age I am not sure I could learn something too different. thanks.
|
|
|
|
|
I know the feeling; i to started back at VB3, as a hobby for small home apps.
The jump to .Net is not that much of a culture shock. I would recommend you at leastdownload the free versions from microsoft and give it a go. It won't be long before you wont want to go back to VB6!
go on, be brave
Cheers,
|
|
|
|
|
|
I think the "newPicBox.BringToFront()" should be newPicBox.zorder as it is being done at runtime - not design time?
|
|
|
|
|
How can i generate bar code of 128 using vb6. i require free control (not trial) for it. help please
Tufail
|
|
|
|
|
Given that VB6 has been obsolete for a long time, why are you using it ? I doubt very much that anyone is still creating VB6 components, or supporting them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Goto wikipedia, search Barcode 128, then select Code 128; there is a link to an open source generator with code, for c++, vb.
I haven't tried the link, or had a look at whats there. surely you can manage to do that yourself.
also google throws up heaps of things, go looooooooook!
|
|
|
|
|
Hi All,
I am trying to implement the following problem in VB with SQL Database:
1) Added a client "R1" in SQL database
2) under "R1", I have to add "R2" - i.e. "R2" client is referred by "R1".
3) similarly "R3" has to be added under "R2"
4) similarly "R4" has to be added under "R3"
So my multilevel Tree structure would be like this : R1 -> R2 -> R3 -> R4
Now how to work on Database to search and add all the clients under their respective referrals.
I am not able to present the problem clearly, but I want to implement a Tree like architecture while programming in VB. I have all the client details in my database.
If anyone can throw some light on this,or provide some reference for programming this kind of architecture, then it would be highly appreciated.
Thanks
R.
|
|
|
|