|
also the first column is blank. The index which is i doesn't show on the fist column
|
|
|
|
|
Hmmmm thats interesting... Anyway this is not right way but try this..
private void button1_Click(object sender, System.EventArgs e)
{
double[] dData = new double[200];
double[] dData2 = new double[200];
ListViewItem newItem = null;
for(int i=0;i<200;i++)
{
dData[i] = Math.Sin(0.09*i);
dData2[i] = Math.Cos(0.1*i);
newItem= new ListViewItem(i.ToString());
newItem.SubItems[1].Text = dData[i].ToString();
newItem.SubItems[2].Text = dData2[i].ToString();
newItem.SubItems.Add(dData[i].ToString());
newItem.SubItems.Add(dData2[i].ToString());
this.listView1.Items.Add(newItem);
}
Cheers,
Jagan
|
|
|
|
|
I received the following error on that line
newItem.SubItems[1].Text = dData[i].ToString();
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
|
|
|
|
|
However by removing the two lines, the rest of the code works fine. This is the one that works
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
double[] dData = new double[200];<br />
double[] dData2 = new double[200];<br />
ListViewItem newItem = null;<br />
<br />
for(int i=0;i<200;i++)<br />
{<br />
dData[i] = Math.Sin(0.09*i);<br />
dData2[i] = Math.Cos(0.1*i);<br />
newItem= new ListViewItem(i.ToString());<br />
newItem.SubItems.Add(dData[i].ToString());<br />
newItem.SubItems.Add(dData2[i].ToString());<br />
this.listView1.Items.Add(newItem);<br />
}<br />
waveformPlot1.PlotY(dData);<br />
waveformPlot2.PlotY(dData2);<br />
}<br />
|
|
|
|
|
Actually i had commented those two lines . However while posting i had mistakenly uncommented those . Sorry for the confusion.
|
|
|
|
|
Hello,
I am sure that I have open only one connection to my SQL Server CE Database but I worked then with another project which also has opened a connection to the same SQL Server CE Database file, but I closed this connection. Now when I want to execute my previous project the File Sharing violation. A different preocess might be using the file. How can I ensure that no more process will use the file?? I also looked in the settings but there is nothing more.
patrick
|
|
|
|
|
Is it possible to draw the drop down list of a combobox a other position?
Is it possible to draw the drop down list to the right side of the combobox?
If possible, what i have to do?
Thanks, Roland
|
|
|
|
|
Hello,
I want to my program to capture the a webpage as an image and show it to the user. Can you please tell me how to do it? I know I should use a WebBrowser control but how can I capture the webpage?
Thanks in advance
|
|
|
|
|
I've got a client who is driving me nuts! They want the user interface for their application to look '24th century' (Trek fan) and have read enough to believe that DirectX is the way to give them a totally unique UI.
I've explained that all the usefullness of the standard Windows controls isn't available when you're using DirectX, but they're determined that their application will look like no other.
From the research and googling I've done it appears that there is some information available about this, but not a lot. Has anyone out there attempted anything like this, or have a pointer to a project by chance?
Or, do I triple my price to cover the effort and start from scratch?
|
|
|
|
|
Actually if you look at the Managed DX samples in the new DirectX SDK there are some standard contrls that can be custom drawn that really do look cool. I think you might even get some/most of the functionality of that control, too.
Of course you could also do the same with all custom drawn controls and just forget about using DX.
Steve Maier, MCSD MCAD
|
|
|
|
|
|
Excellent! Now to decide if I jack my price for the learning curve or eat it because this will be fun to play with....
|
|
|
|
|
Hello!
I need help.
I have impoted the AxMS Comm Control 6 in MS Visual Studio .net 2003 and am using the control in C#. I tried to open ComPort #4 to receive GPS data through USB. However, I couldnt' open it, everytime, it gave me the following exception:
System.RunTime.InteropServices.ComException(0x800A1F45): HRESULT 0x800A1F45
Could somebody kind enough to help me solve this problem? Any suggestion would be appreciated!
Regards,
Stephen
|
|
|
|
|
i once (upon a time) had troubled with the comm control. are u sure it can be used for USB connections? Anyway, we used to troubleshoot the comm ports using HyperTerminal (an old unfriendly thing u can find in programs-accessories-communication), and u need to know what to send through this com port.
there are no facts, only interpretations
|
|
|
|
|
I've successfully invoked a COM method, which returns a ref to an object:
object oNames ;
...
axGTVX1.QueryAvailableList( ref oNames );
The object is an array of strings. In the VS.Net debug watch window, I can see the array and its values:
- oNames {System.Array} System.Object
[0] "Pole" string
[1] "Substation" string
...
However, I can't access it as an array (if I try to watch oNames[0], the message 'object needs an indexer' appears). I've tried various approaches to cast or index this object, to no avail. THIS SHOULD BE SIMPLE.
Tim
|
|
|
|
|
<br />
string [] aNames = ((string[])oNames);<br />
|
|
|
|
|
I tried that, and got a runtime error at that line:
System.InvalidCastException: Specified cast is not valid.
Thanks for the response.
|
|
|
|
|
Tim Atkins wrote:
System.InvalidCastException: Specified cast is not valid.
I'll admit I dont know the library you are dealing with, but the value being ref'ed out of that method isnt a string array if you are getting that error from that line of code.
|
|
|
|
|
Hello,
This may have been asked before, but my net access is too slow today, and I can't seem to find any answer, so here it is:
How can I get the file version of the current assembly (from the AssemblyVersion attribute)? I want to display it in the About box.
Thanks,
-- LuisR
___________
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
|
|
|
|
|
|
Hello leppie,
Thanks for your reply.
I tried this:
foreach(AssemblyVersionAttribute avat in Assembly.GetExecutingAssembly().
GetCustomAttributes(typeof(AssemblyVersionAttribute), true))
{
MessageBox.Show(avat.Version);
break;
}
and it doesn't work. The loop doesn't execute, as if it couldn't find any attributes of that type.
I have this on another source file in the same project (and it is displayed when I click Properties on my .exe in Windows Explorer):
[assembly: AssemblyVersion("1.0.4287.0")]
Any ideas?
-- LuisR
___________
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
|
|
|
|
|
I just put this piece of code in my About box to get the latest version..
this.lblVersion.Text = "Version "
+ (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString())
+ "."
+ (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString())
+ "."
+ (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString())
+ "."
+ (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision.ToString());
|
|
|
|
|
|
Hi,
is it possible to open a window containing all the files in a directory and letting the user choose a file to be renamed? I've written the code to open the window and display the files and I'm fairly sure the next step will involve the File.Copy or File.Move method but I can't work out the next few lines of code.
The selected file will always be renamed under the same term (ie somefile.txt) as there are more processes to be carried out on the file before it is finished with. The user can then select the next file in the list to be renamed and so the process continues ad nauseum (until I write the code to loop it. Rookies eh?)
The code thus far looks like the following, (sorry, I know you all know what this looks like, just thought it was better to include it than not)
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "CET File (*.cet)|*.cet|PET File (*.pet)|*.pet|All files|*.*";
sfd.Title = "Save File as";
sfd.FileName = @"c:\temp\thisfile.txt";
if(sfd.ShowDialog() == DialogResult.OK)
{
}
Like I say, I'm almost positive there is some clever use of the File.Move or File.Copy method to be invoked here. I got it to work when I coded in a specifically chosen filename but that obviously only works on one pass. I need it to be user-selected. Please can someone out there help?
Thank you in advance
Scotty
|
|
|
|
|
how about:
if(sfd.ShowDialog() == DialogResult.OK)
{
System.IO.File.Copy(myfile,sfd.FileName,true);
}
where myfile is a string with the original file name, and true alows overwriting? or have i misunderstood your question?
there are no facts, only interpretations
|
|
|
|