|
How will you create a 64–bit application using Visual Studio .NET 2003?
|
|
|
|
|
Set the Platform Target in the project properties to x64
only two letters away from being an asset
|
|
|
|
|
That'll work for C# in Visual Studio.NET 2005, but not in VS.NET 2003.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All
How I can Use Thread with ListView To Add this Items
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring }); <br />
this.listView1.Items.Add(lvi);
|
|
|
|
|
Hi,
You can create new object of Thread class and assign a function which will perform the above said operation for you. Remember that the function should not return any thing (ie return type = void ) and should not accept any arguments. In case if you want to pass some arguments when the thread will actually start then you can use fields or properties which would be accessible from inside the function. For example --
Thread objThread = new Thread(new ThreadStart(this.FunctionName));<br />
objThread.Start();
the FunctionName would be your function defined as below--
public void FunctionName()<br />
{<br />
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring });<br />
this.listView1.Items.Add(lvi);<br />
}<br />
If you want now to pass any arguments to FunctionName then use fields or properties. Means before u call objThread.Start() assign the right fields with the values you want to pass to the Thread.
Hope i am clear !
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
thanks Anant Y. Kulkarni
I am use this code
private void loadSubToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
<br />
OpenFileDialog1.Filter= "Srt File|*.srt";<br />
OpenFileDialog1.Title = "Open SubTitle File";<br />
try<br />
{<br />
if (OpenFileDialog1.ShowDialog() == DialogResult.OK)<br />
{<br />
Thread ReadThread = new Thread(new ThreadStart(ReadData));<br />
ReadThread.Start();<br />
}<br />
}<br />
catch (Exception)<br />
{<br />
MessageBox.Show("Can't Read this File");<br />
}<br />
}
and this Function
private void ReadData()<br />
{<br />
listView1.Items.Clear();<br />
StreamReader s = new StreamReader(OpenFileDialog1.FileName, Encoding.Default);<br />
ArrayList a = new ArrayList();<br />
while (s.Peek() >= 0)<br />
{<br />
string alltext = "";<br />
string text = "";<br />
while ((text = s.ReadLine()) != "" && text != null)<br />
{<br />
alltext += ("|" + text);<br />
}<br />
a.Add(alltext);<br />
}<br />
s.Close();<br />
foreach (string text in a)<br />
{<br />
string[] splitString = text.Split('|');<br />
string tempstring = "";<br />
for (int i = 3; i < splitString.Length; i++)<br />
{<br />
tempstring += splitString[i];<br />
}<br />
ListViewItem lvi = new ListViewItem(new string[] { splitString[1], splitString[2].Substring(0, 12), splitString[2].Substring(17, 12), tempstring }); <br />
this.listView1.Items.Add(lvi);<br />
}<br />
a.Clear();<br />
}
when i Run this Program this message Dispaly
Exception System.InvalidOperationException was thrown in debuggee:
Cross-thread operation not valid: Control 'listView1' accessed from a thread other than the thread it was created on
|
|
|
|
|
|
how to get single item in foreach loop ??
here is the sample
foreach (clsLabels lbl in m_clsLabelCollection)
{
lstlblname.Items.Add(lbl.label);
lstlblvalue.Items.Add(lbl.Value);
lstcustext.Items.Add(lbl.customValue);
}
i want a perticular lable from the clsLabelCollection(collection class inherited from CollectionBase) class
clsLabels constructor added to clsLabelCollectionclass
clsLabels(string,string,string)
sikandar
|
|
|
|
|
sikandarhayat wrote: i want a perticular lable
Whats different on this label?
|
|
|
|
|
actually clscollection class contain a list of labels
and i want if a perticualr label name equals"name" which is exists in the collection class.
how can i extract it.
thanks for reply
sikandar
|
|
|
|
|
Hello,
Got it now!
foreach(Label l in clscollection)
{
if(l.Name == "yourename")
{
//thats it
}
}
All the best,
Martin
-- modified at 4:17 Friday 25th August, 2006
|
|
|
|
|
hi
no not in that way
i mean is there any other way loop mean continous searching i want to save time i do not want to compare just assign of perticular.
if possible
thanks.
sikandar
|
|
|
|
|
An ArrayList (the inner list of the CollectionBase) has nothing that supports accessing items in any other way.
You can use a HashTable and use the name of the label as key, then you can access the labels directly by name.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
you can use
lbl.Name ie,
if (lbl.Name.Equals("your constant value"))
{
//your code goes here
}
property.
hope this works.
Nitin...
|
|
|
|
|
Double up the collection. Often I will use both a list and a hash in 1.1. I use the list for iteration and the hash for indexing. If the data is good enough I will keep it in an Array List sorted and Binary Search it.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Since you mentioned that clsLabelCollection inherits from CollectionBase, it should have a Contains and an IndexOf method.
Assuming that both of these are actually implemented in the collection class, you can use them to find a specific clsLabels instance:
clsLabels l = null;
if (m_clsLabelCollection.Contains("value"))
{
int i = m_clsLabelCollection.IndexOf("value");
l = m_clsLabelCollection[i];
}
You can also iterate over the collection (using foreach) and explicitly test to see if the current item is equal to the one you want. When you find the match, break out of the loop.
This would be something like this:
clsLabels l = null;
foreach(clsLabels lbl in m_clsLabelCollection)
{
if (lbl.label == "value")
{
l = lbl;
break;
}
}
I'm assuming that lbl.label is a string field and that you are looking for the label "value".
|
|
|
|
|
Hello!
How many GraphicsState can we save. Does it depend on hardware capability? If so, how to get that stack size?
<br />
GraphicsState state1 = g.Save();<br />
GraphicsState state2 = g.Save();<br />
GraphicsState state3 = g.Save();<br />
...<br />
g.Restore(state3);<br />
g.Restore(state2);<br />
g.Restore(state1);<br /> ]
Thank you.
Sovann
|
|
|
|
|
s o v a n n wrote: If so, how to get that stack size?
I dont think you want to call that recursively, its a rather expensive operation. Performace will be terrible before you hit stack overflow.
|
|
|
|
|
Dear All,
I am showing some thumbnail pictures in a listbox. Thumbnails have category. Now I want to show tumbnails category wise in ListBOx. So that i can expand or collapse each category to see thumbnails like tree view. Have anybody some idea about it?
|
|
|
|
|
can you use a listview but listbox?
because the listview has SmallImageList property. it can show picture on a item.
|
|
|
|
|
hi all,
i need to know wht input will satisfy this condition
DateTime tm=DateTime.ParseExact(sar[1],new String [] {"t","T"},CultureInfo.CurrentCulture,DateTimeStyles.AllowWhiteSpaces|DateTimeStyles.NoCurrentDateDefault);
in this above sar[] wht should i pass in
this below is my method which accepts DayofweekandTime as input.
String [] sar=delay.Split(new char [] {' '});
if(sar.Length<2) return DateTime.MinValue;
sar[0]=sar[0].Trim().ToUpper();
DateTime tm=DateTime.ParseExact(sar[1],new String [] {"t","T"},CultureInfo.CurrentCulture,DateTimeStyles.AllowWhiteSpaces|DateTimeStyles.NoCurrentDateDefault);
tm=new DateTime(2003,1,6)+new TimeSpan(0,tm.Hour,tm.Minute,tm.Second,tm.Millisecond);
for(int i=0; i<7; i++) { if(tm.ToString("ddd").ToUpper()==sar[0]) return tm; tm+=new TimeSpan(1,0,0,0); }
return DateTime.MinValue;
thanks in advance....
-- modified at 2:48 Friday 25th August, 2006
|
|
|
|
|
You can input anything that matches the ShortTimePattern or LongTimePattern of the current culture.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Dear Respected Programmers
Kindly give me the solution that, How may I get Form1.textBox1.Value into my crystalReport1 ==>> Text1
Thank you very much in Advance
and
Have a nice day
|
|
|
|
|
Hi.
you can use parameter property of Crystal report.
add the parameter in the crystal report and then set its value from your code.
hope this works.
Nitin...
|
|
|
|
|
Hello in keypress event for a text box i want to convert the e.KeyChar into the actual character how do i make it do this?
|
|
|
|