|
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?
|
|
|
|
|
Hello Tyrus,
I think two things are possible here.
Inside your keypress event:
1)
if(e.KeyChar == ??)
{
e.Handled = true;
SendKeys.Send("{???}");
}
2)
if(e.KeyChar == ??)
{
e.Handled = true;
textbox.Text.Insert....
}
All the best,
Martin
|
|
|
|
|
no im actualy an idiot apparently KeyChar is already a char :P not an enumeration.
|
|
|
|
|
Ohhh,
then I didn't got youre question!
All the best,
Martin
|
|
|
|
|
Hi,
I am Developing an application for Windows Mobile,Using VS2005 c# and SQLite Database.
I cannot bind the data to the List View as Columns, I can bind only one column.
Please,Anybody help me
|
|
|
|
|
hi id like to prevent people from pasting in my text box what is the best way to trap the keyboard commands and stop the paste menu from poping up on right click?
|
|
|
|
|
Hello Tyrus,
In this case you should use the KeyDown Event.
this.textbox.KeyDown += new KeyEventHandler(CheckKeys);<br />
<br />
<br />
private void CheckKeys(object sender, KeyEventArgs e)<br />
{<br />
if (e.Control && e.KeyCode == Keys.V)<br />
e.Handled = true;<br />
}
All the best,
Martin
|
|
|
|
|
any idea how i can disable the context menu that pops up with i right click?
|
|
|
|
|
Hello Tyrus,
Maybe for your project it would be helpfull if you use a MYTextBox class which inherits from windowsd Textbox.
There you can override the MouseUp Event.
protected override void OnMouseUp(MouseEventArgs e)<br />
{<br />
if(e.Button != MouseButtons.Right)<br />
{<br />
base.OnMouseUp (e);<br />
}<br />
}
Hope it works for you!
All the best,
Martin
|
|
|
|