|
This line doesn't accomplish anything:
ParentArrayList.ToArray()
Sure, it does create an array, but you throw it away immediately. The method returns the array, so you have to take care of the return value:
ParentArray = ParentArrayList.ToArray()
But why are you turning the list into an array anyway?
Once you put the child array in the parent list, you can access a child array like this:
CType(ParentArrayList(0), String())
(With reservation for syntax errors, I program in C# normally.)
To access the items in the child array, just use an index on the array:
CType(ParentArrayList(0), String())(0)
---
b { font-weight: normal; }
|
|
|
|
|
The .ToArray was pretty much just grasping at straws because of what I thought was a casting error. But, your explanation helped quite a bit and everything's working just great.
Thanks for your help!
-------------------
abort, retry, fail?
|
|
|
|
|
How do you add details in a listview of 2 columns in vb.net. a listView is already created. i need to create a new ListViewItem and add details in the listview from 2 string arrays in the corresponding 2 columns!! Plz Help!! Thanx!!
Devraj Raut!!!
|
|
|
|
|
You can find an example of how to do this right on the first page of the ListView docs[^].
With ListView1
.View = View.Details
.AllowColumnReorder = False
.FullRowSelect = True
.Columns.Add("Item Column", -2, HorizontalAlignment.Left)
.Columns.Add("Column 2", -2, HorizontalAlignment.Left)
End With
Dim myItem As New ListViewItem("something", 0)
myItem.SubItems.Add("column 2 data")
ListView1.Items.Add(myItem)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi;
First rightclick LV and get its properties. in general tab set view to reportview.In columnheaders tab add two columnheaders and add 2 captions for it if you like.
then
Sub Form_load or something else
dim I as integer
Dim lst as listitem
for i=lbound(StringArray1) to ubound(StringArray1)
set lst=listview1.listitems.add(I,,StringArray1(1)) '.Add(Index,Key,text,Icon).You can add a unique key if you like or needed to for each item.
lst.subitems(1)=StringArray(2)
next i
i hope this will work
bye
Kanchana
|
|
|
|
|
When printing a report developed in Crystal Reports in windows application, the application is giving an error : "Invalid printer specified."
misecprj
|
|
|
|
|
It would appear that the printer name you gave doesn't match the name of a printer installed on the machine. But without seeing your code to setup your printing, it's really hard to tell what happened.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to use my own icon on all form of windows application. And I set "Application Icon" of Build item in Common Properties folder of project's Properties with my icon file. Unfortunately when I set the Icon property to my own icon, in Icon property of a window form I can see my icon, but on the form it shows the Solution Explorer's icon file's icon. How can I fix that?
Also when I deploy my application, I set icon for desktop and window Start up's All Program using same icon file. I don't know why on desktop it shows my icon, but on Start up menu it displays vb.net
Solution Explorer's icon file's icon. What cause this problem and is there a way to correct it?
Thanks in advance.
|
|
|
|
|
An icon file can contain different sizes for the same icon, but you have to create these sizes. The system will look in the icon file for the appropriate size image it needs for where the icon is going to be displayed. If the appropriate size is not found in the file, a default icon is used.
Edit the icon file and add images for, say 32x32 and 16x16. Some implementations, like Explorer's Large Icon view in Windows XP, can look for a 64x64 image of your icon.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you. My icon file size is 1.05 KB and the icon is 32x32. What is the appropiate size for my window's application built with vb.net 2003?
|
|
|
|
|
Like I said, It depends on where the icon is being used. You obviously can't put a 32x32 icon on the title bar of your app, so it should include BOTH 32x32 and 16x16 icons. So long as you provide the different sizes, Windows will pick the appropriate size for where it's used.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you so much for your help and patience. I'm quite new to vb.net. Would you please tell me how can I include both 32x32 and 16x16 icons in my application, since project property only allows me to set one icon file there?
|
|
|
|
|
Double-click the icon file to edit it in the IDE. Hit Insert (or the Image/New Image Type menu) to add a new image size to the file. Draw the new size icon image and save the file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you so much. I got it.
|
|
|
|
|
Do the following to change your app's icon:
1) Go to the Solution Explorer.
2) Right click on your project and select Properties.
3) Select CommonProperties\Build from the tree on the left.
4) Modify the Application icon field and click OK.
|
|
|
|
|
Thank you. I did exactly the same thing as you described. That's why I don't know what's wrong.
|
|
|
|
|
What you did was change the application (EXE file's) icon.
Are you trying to change the form's icon instead? In that case, just open your form in the designer, go to its Properties panel, and change the Icon property from there.
|
|
|
|
|
|
Hi Guys!! I need to declare a string array of undefined size and i want the size to grow as and when i insert values into them. plz tell me how can this be done and if not possible tell me an alternative. Thanx!! Plz reply soon. u know who i am right. The guy with the .NET Project on Bit Torrent. Cya!!
Devraj Raut!!!
|
|
|
|
|
2 Options:
1) You can recreate the string array with 1 greater element, copy the items and place the new item.
private string[] ExpandAndInsertToArray(string [] original, string newItem)
{
string [] newArr = new string[original.Length+1];
original.CopyTo(newArr,0)
newArr[newArr.Length-1] = newItem;
return newArr;
}
2) You can use a list such as ArrayList which will dynamically expand
ArrayList list = new ArrayList();<br />
list.Add("String1")<br />
list.Add("String2");
this can stillbe converted to a string array when needed
string[] strArray = (string[])list.ToArray(typeof(string))
-- modified at 9:22 Wednesday 18th January, 2006
|
|
|
|
|
Posting C# code in the VB.NET Forum?! Shame on you!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
D'oh! I switch so frequently between the 2 forums, that sometimes I forget where I am.
|
|
|
|
|
I do the same thing. I've spent sooo much time around here, it's impossible to keep everything straight. At least it's not as bad to post foreign code here as it is to post VB code in any of the "C" forums. Try posting VBScript code in the C++ forum, then run for cover!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Jamie is essentially correct, but supplied the code in the wrong language.
You can ReDim Preserve an array to the new size you want, but this is very inefficient.
Dim ub As Integer = UBound(myStrings, 1) + 1
ReDim Preserve myStrings( ub )
myStrings(ub) = "something"
2) You can use a list such as ArrayList which will dynamically expand
Dim list As New ArrayList
list.Add("String1")
list.Add("String2")
this can still be converted to a string array when needed
Dim strArray As String() = list.ToArray(GetType(String))
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I want to know that what is replacement of the INI files
Actually i have to save some settings like open connection, forms colorings etc
in the settings files
So what type of file i have to use in Vb2005
XML / Config/Settings what r they????
Thanks in advance
Regards
Hema Chaudhry
|
|
|
|