|
Hi!
For that you'll definitely need to use the Win32 API.
Take a look at the LVM_* messages and the LVITEM struct in MSDN, for example LVM_GETITEMCOUNT and LVM_GETITEM .
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
As mav mentioned, you can do this using the Win32 API. However, be aware that this will only work for Win32-based applications; WinFX/.NET 3 apps that use new Windows Presentation Foundation (WPF) do not have HWNDs for individual controls, and neither do they have Win32 message pumps. Because of this, it will be impossible to get at the ListViewItems of another process (a WPF-based one) unless that process specifically chooses to expose it to you.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi there, Can anyone help me with this problem?
I have two window forms Form1 and Form2. This Form1 i used the following to showing Form2.
Form1:
Form2 form2 = new Form2();
...
form2.Show();
Hide();
And then i want to make a link when it is clicked, it shows the Form1 and hide the Form2:
in Form2:
Form1 form1 = new Form1(); <-- this keep gives me error.
...
form1.Show();
Hide();
When i tired to click on the link on Form2 so that i can get back to Form1, it give me an error. The whole thing doesn't work... i remembered it used to be much easier to do it in VB6 but how does it work in C#...
If anyone knows please help me thanks!
|
|
|
|
|
Hello
Esay with the frustration.
now to sum up: You have to forms and you want to show them one at a time -ie. not both at the same time-.
1- Create a Form2 object in Form1
2- When you click the link
this.hide();
MyForm2.ShowDialog(); //This will block code execution until you close Form2
this.Show();
Regards
|
|
|
|
|
Thanks alot that really helps. I think i can use this for handle showing and hiding multi-forms one at a time.
|
|
|
|
|
to hide form 1 you need to use the "this" identifyer so that the form knows the correct form to hide, so this.Hide(); is the correct way to hide the form. Also unless you are planning on creating a new instance of form 1, you need to pass form1 over to form2 in the constructor similar to the following:
Form2.css
//Default Constructor
static void Form2()
{
InitializeComponents();
}
//Constructor to bring in Form1
static void Form2(Form frm1)
{
Form1 form1 = frm1;
InitializeComponents();
}
Then you can reference the already existing form 1 and show it by making the statement:
form1.Show();
this.Hide();
and the way you pass Form1 (in Form1.css) over to Form2 is:
Form2 form2 = new Form2(Form1);
At least I think what I have told you is correct.
|
|
|
|
|
Ok, thx for the advise! In fact i solved that prob a while ago when i read the first reply. It goes like this:
In Form 1:
public partial class Form1 : Form
{
private Form2 form2;
...
private void link1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
form2 = new Form2();
form2.Show();
Hide();
}
...
}
In Form 2:
public partial class Form2 : Form
{
private Form1 form1;
...
private void link1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
form1 = new Form1();
form1.Show();
Hide();
}
...
}
I think it works in showing and hiding between different forms if i only use the "new form()" within the link function but i'm not sure if this is a good practice though...
|
|
|
|
|
the thing is i've been workin' on a project for quite some time, and i have a method, with 6 arrays, each one with 100 elements. I'm preatty sure i'm not going to complete all those elements, and i don't want my program to chew up memory like a termite chews wood. If i was workin' in vb...i would simply redim preserve all the arrays, but i don't know how 2 do that in c#. and i can'd include a vb class in a c# project! So what do i do?
Please help me!
rzvme
|
|
|
|
|
hi
C# can't dynamically resize an array.
try to use the array list
Tamimi - Code
|
|
|
|
|
The "ReDim Preserve" functionality is intentionally left out in .NET, as there is no other way of resizing an array than to create a new array and copy the elements from the old array.
There are methods in the Array class to copy the elements, but there is no "Resize" method that would hide this resource consuming task from view. If you really want to do this, you can, but you can't do it "by mistake".
As Tamimi said, you should use an ArrayList instead, as it automatically grows as needed. Or better yet, if you are using .NET 2, use a generic list to make the code type safe.
---
b { font-weight: normal; }
|
|
|
|
|
It should be noted that the arraylist uses arrays internally and it does the same as described above.
So creating new arrays and copy its content is not slower than using the arraylist.
but do use the lists since they are already created for this purpose, but dont expect them to be any faster..
//Roger
|
|
|
|
|
2.0 does have a Resize method
int[] arr = {1,2,3,4,5,6,7,8,9};
Array.Resize(ref arr, 3);
or
Array.Resize(ref arr, 20);
only two letters away from being an asset
|
|
|
|
|
There is the static System.Array.Resize method, however, as others have stated, if you need to be resizing lists, your best bet is to use the System.Collections.Generic.List object.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
|
hello
i have started a small database application and i want to use the aggregate function (max) to find the maximum id in a table that is placed inthe dataset named ds.... i searched through alot of books but am unable to do so... though a result set execute scalar would help me to write the statement but i want it to be executed on a data set....
thankyou
haseeb
|
|
|
|
|
Hello
if you're dealing with a datatable in a dataset, why not trying something like this
int Max = 0;
foreach(DataRow MyRow in MyDataTable.Rows)
{
if((int)MyRow.ItemArray[MyIndex].Value > Max)
Max = (int)MyRow.ItemArray[MyIndex].Value;
}
I hope I got you right
Regards
|
|
|
|
|
Hi,
Slightly off topic - if you know of a good place elsewhere to ask then please let me know
I want to put a textbox or field into a crystal report and that textbox is filled by reading in a text file at run time. To clarify, a user types in their text which could be several pages using their favourite wordprocessor and then the contents are incorporated into the Crystal Report generated by the program in much the same way as database fields are.
Is this possible?
If not, are there any alternatives to achieving the same end result?
Glen Harvy
|
|
|
|
|
In older versions of Crystal the answer was no although you could have tried working with OLE objetcs (not recommended, it was a nightmare!) but now with the latest versions you can write VB code that should permit you to do what you want. I think you need at least version 10, or maybe version 9 can't rmenber exactely when VB code was introduced.
|
|
|
|
|
Thanks for the response.
~~~Johnny~~~ wrote: with OLE objetcs (not recommended, it was a nightmare!)
I was looking at this and I think you're right
~~~Johnny~~~ wrote: least version 10,
That's the version that ships with VS2005 - or at least a cut down version anyway.
Any idea where I may be able to find somewhere on the net that tells me how to do it?
Glen Harvy
|
|
|
|
|
Personnaly I lloked at the version that ships with VS and ordered the full version right away. There is no way you will create reports with this version if you want to use the features of Crystal Reports. In the shipped version you have to prepare your data before hand and then create the report besed on that.
If you feel you need more help try the http://www.businessobjects.com but again, any help you get from there might not apply as you don't have the full version.
|
|
|
|
|
-------------------------------------------------------------------
I am reading pixel by pixel from a image, creating a color object corresponding to that pixels color and witing a "." into a word file and coloring it with the same color as the pixel.
But Word.wdColor has only 60 colors I am not able to relate the color object with Word.wdColor enum.
-------------------------------------------------------------------
Every is Illusion
|
|
|
|
|
Hello
Try to transform it to the closest color using its RGB value.
Regards
|
|
|
|
|
Hi All,
I have a button on my form. When the button is selected and TAB is hit, am not able to capture this event. How can I capture the tab event on a button?
Its urgent, anykind of help is highly appreciated .
Thanks in advance
Regards
Kais
|
|
|
|
|
Check out this link
http://www.wdvl.com/Authoring/Scripting/Tutorial/java_event_others.html
Hope it will help u
Navi
|
|
|
|
|
Thanks Navi,
The link you provided holds good for JAVA but not for C#.
Let me know if you can help me out in C#.
Regards
Kais
|
|
|
|