|
I think things are a little clearer. I've now got a general picture of your scenerio. For all I know there is a brilliant solution to your overall problem, but I don't have one. However, I'll give you what I've got. You can add items to the listview with a key and then access that item using that key. Now from what I understand you've got food items in listviewB. So the name of the item would be the key. The user selects say 'Breakfast' from ListViewA. You then get the food items the user wants for breakfast and store that in an arraylist. You could then access each item in ListViewB directly by using the items name because you used the name as the key. Hopefully some code will make this clearer. Here is a little example which shows what I'm talking about.
'---Add items with keys---
With ListView1.Items
.Add("Steak", "Steak", "")
.Add("Apple", "Apple", "")
.Add("Rice", "Rice", "")
End With
'---Uncheck previous items---
For i As Integer = ListView1.CheckedItems.Count - 1 To 0 Step -1
ListView1.CheckedItems(i).Checked = False
Next
Dim itemsToSelect As String() = {"Steak", "Rice"}
For Each item As String In itemsToSelect
ListView1.Items(item).Checked = True
Next
One thing I don't understand is why does ListViewB have check boxes and why are you checking the items instead of filling ListViewB with just the items the user had selected for 'Breakfast'? It seems to me this would be a nicer approach but maybe there is more to this that I don't understand yet. Either way the code I posted should give you an idea of how to more directly access each item instead of looping through all the items in the list.
|
|
|
|
|
Hello !
I'm currently quite a problem I can't figure out.
I have a VB6 ActiveX that does numerous actions on an Oracle database. This component calls another one that sends the queries to the database.
It uses MTS transactions with GetObjectContext.
For years it has worked perfectly !
Since couple of months I'm having the weirdest problems with it.
The most significant is a delay whenever I insert or update records in the database.
Sometimes it takes 10~15 seconds before the data is actually in the database.
Sadly there's no way I can test that on my machine since the problem is random !
Out of all actions it performs, a mere 10% comes out bad and I have to manually correct them.
The database component is called by many other applications on the same server and works just fine. No other applications have shown anything like this problem.
My component uses just the same settings as the others one.
The component uses very few CPU and through the Component Services mmc I can see it runs without delay but the data it's written is magically delayed for whatever reason...
The server is a Windows 2003 on which we later installed SP1.
As I'm running out of ideas to try to solve it, I'm about to rewrite part of it unless some clever member here would know what it's happening !
Thanks in advance !!
|
|
|
|
|
i make a project... Now ! How can i make an installable file...? or Setup.exe file of my project
Your Good Thinker
|
|
|
|
|
goto menu debug
Publish
Set program to be installed from the setup path(installs the pre-requists first).
in a developed project its better to make setup project to have more options.
A.E.K
|
|
|
|
|
Which VB version you have? 2003 or 2005, express or studio,....
|
|
|
|
|
Thanks for reply dear i am using VB.NET 2005
Feroze
|
|
|
|
|
then if you have vb.net 2005 express you can publish as amir e sad... or if you have vb.net 2005 studio, architect or team edition whatever then you can sett up your setup settings as you wish an you can fully costumize it as you wish! Well hope i helped u... and sorry on bad English i am from Croatia. Enjoy!
|
|
|
|
|
i make a project... Now ! How can i make an installable file...?
Your Good Thinker
|
|
|
|
|
There are a number of articles on this topic. Such as this one.[^] You should search for the key words "Deployment" and "Setup project" for more information.
Hope this helps.
|
|
|
|
|
I have never used XML in windows application vb.net. I want to create if doesnt exist an xml file then be able to add nodes to it and finally search for a certain node name/id.
Can any one provide me with an answer or link to a usefull web site cause i googled a little and didnt find any thing helpfull
Thanks
|
|
|
|
|
XmlDocument is the class you need, and it impliments what's called the DOM ( document object model ). This is a standard API, so you can search for help on it's methods, such as selectSingleNode, and find lots of help. XPath is the language you use to find nodes, heaps of stuff on the web about this also.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have created my application and want it to look good. What I have is a screensaver I want to play first for 10 seconds when program starts then "Login form" will load. How would you do this? Here is what i want to happen:
You click on "Program.exe" the screensaver loads in fullscreen and plays for 10 seconds. It closes and "Login Form" loads.
Using VB.net 2005
In the end we're all just the same
|
|
|
|
|
you can make a form with formborderstyle=none and set the background in the way you want.
add a timer to your source code and set its interval= 10000 and enabled = true
add another form for your login
add code below in the timer tick sub
dim Mylogin as new frmlogin
hide
mylogin.show
timer1.enabled=false
if this can not solve your problems please describe that what is your exact problem
A.E.K
|
|
|
|
|
When im in debugging mode - and let say that im watching a object. to the left of the objects name in the watch window is a (+) meaning i can drill down. but when i click on it it simply disapears without drilling down. few weks ago my watch window was working ok - meaning i could drill down an see the properties/methods of the object i as watching. do you think there i a setting i might have switched off?
ONeil
|
|
|
|
|
i want to create conaction Between web cam and PictureBox
Want an example thnx
Ahmed El-Badry
|
|
|
|
|
You need DirectShow, search the site, there are many examples to download.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i want to add Button and imge in DataGrid Using vs.net 2003
Want an example
Ahmed El-Badry
|
|
|
|
|
you have to change the style of each column in the property:collection of you gridview to whatever you want
eg. button,combobox,checkbox,....
A.E.K
|
|
|
|
|
Thank you for your help
I want an example Plz
Thank you again
Ahmed El-Badry
|
|
|
|
|
Hello,
I have a typed dataset which I want to display in an ultragrid (infragistics) and display the parent and the children.
I can display this ok when I want to display all of the parents and children. But the user will need to select one parent from a list and display that parent with its children in the grid.
I have created the dataset schema dsAssembliedEquipment.xsd and my 2 tables assembly and AssembiledEquipment.
I have a stored procedure (getDataByCustomerID) that will find the customerID of the assembly (parent) table.
This is my code for setting the ultragrid.
<br />
'Table Adapter to get the customer ID record<br />
Me.TA_Assembly1.GetDataCustomerID(customerID)<br />
'Fill the assembly (parent) table and assembliedEquipment table(child)<br />
Me.TA_Assembly1.Fill(Me.DsAssemblyEquipment1.Assembly)<br />
Me.TA_AssembliedEquipment1.Fill(Me.DsAssemblyEquipment1.AssembliedEquipment)<br />
<br />
Me.grdCustomersAssembly.DataMember = "Assembly"<br />
Me.grdCustomersAssembly.DataSource = Me.DsAssemblyEquipment1<br />
However, this displays all of them of the parents and children.
I think this is something wrong and the dataset not getting filled correctly.
Many thanks for any direction on this,
Steve
|
|
|
|
|
Hi Steve,
you will need to add a DataRelation between the parent and child DataTable in the DataSet.
DsAssemblyEquipment1.Relations.Add(...)
See MSDN for details.
Andi
|
|
|
|
|
Hello Andi,
I will give that a try.
However, I have created in the relationship in the DsAssemblyEquipment.xsd designer.
Another thing the parent and child works when you want to display all of them in the datagrid, but if you want to display just one parent and the children that belong to that parent, that is where the trouble is. It keeps displaying all of them.
The code I gave above displayed all of them either though i have created the relationship in the xsd designer.
Any ideas,
Thanks very much.
Steve
|
|
|
|
|
Hi Steve,
sorry but I don't know, what all those designers inside VS do, because I'm not using them. I always prefer to write the code on my own so I (hopefully) know what's going on.
However, what do you mean by "displays all of them"? All parent records? Your code seems to select only one. If you mean all child records this begs the question why you select them if you only need those of one specific parent.
It's been a while since I last worked with the infragistics grid, but IIRC this kind of scenario just worked for me. Did you check for the correct setting of the grid's DataMember property? Is there a table with that name in your dataset?
Andi
|
|
|
|
|
Hello Andi,
Thanks for your reply - I did try and make the relationship in code, just to see if it made any difference
<br />
Dim parentColumn As DataColumn = Me.DsCustomerEquipment1._Assembly.Columns("AssemblyID")<br />
Dim childColumn As DataColumn = Me.DsCustomerEquipment1.AssembliedEquipment.Columns("AssemblyID")<br />
<br />
Me.DsCustomerEquipment1.Relations.Clear()<br />
Dim drAssemblies As New DataRelation("AssemblyDetails", parentColumn, childColumn)<br />
Me.DsCustomerEquipment1.Relations.Add(drAssemblies)<br />
<br />
Me.UltraGrid2.DataSource = Me.DsCustomerEquipment1<br />
<br />
Me.UltraGrid1.DataMember = "Assembly"<br />
Me.UltraGrid1.DataSource = Me.DsCustomerEquipment1<br />
Displays all of the parents and children. Which is not what I want. Let me explain I have Assembly Table fields AssemblyID | customerID | AssemblyName
I have child table called AssemblyEquipment fields SerialNo | make | Model | AssemblyID (Foreign Key)
The user will selects a customer and then the grid should display the customer's assembly and the assembly will show all the equipment that is contained in that assembly.
I have just tried this but it didn't work
<br />
'Select the parents with customerID number 2 and fill the dataset<br />
Me.AssemblyTableAdapter1.GetDataByCustomerID(2)<br />
Me.AssemblyTableAdapter1.Fill(Me.DsCustomerEquipment1._Assembly)<br />
'Set the databinding for the grid<br />
Me.UltraGrid1.SetDataBinding(Me.DsCustomerEquipment1, "Assembly")<br />
Hope you can help,
Many thanks and most grateful,
Steve
|
|
|
|
|
Hi Steve,
I see that you are working with two grids, one for the parent data and one for the children. I just used one grid to display them both. A thing which the UltraGrid does quite well.
I just dug out my old project, where I used the Infragistics grid (Version 3).
The code that works (.NET 1.1) creates a New DataSet in which two DataTables are created and filled via DataAdapter.Fill and following DataSet.Tables.Add(). The DataRelation is added just like in your code and the DataSet is bound to the grid's DataSource property. All other properties of the grid with their default values.
In the code you posted it seems that you are setting UltraGrid1's datasource twice:
Me.UltraGrid1.DataMember = "Assembly"<br />
Me.UltraGrid1.DataSource = Me.DsCustomerEquipment1
and
Me.UltraGrid1.SetDataBinding(Me.DsCustomerEquipment1, "Assembly")
Could this be the problem? Otherwise I don't have any more ideas
Andi
|
|
|
|