|
You almost convinced me to embrace nullable types...
|
|
|
|
|
I didn't think to use nullable types until some time after I posted.
Thanks for reminding me, I'll get right on that.
|
|
|
|
|
Luc Pattyn wrote: You almost convinced me to embrace nullable types...
Nullable types are gooooodddd!!! Come and see the pretty nullable types.....
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
"Use the right tool for the right job." -- Scotty... and my grandfather
|
|
|
|
|
Hi Colin,
I'm sure nullable types have some value (no pun intended), otherwise they
would not have been added to C#.
So far whenever I was short of a special value (such as DateTime.MinValue),
I used a class rather than a struct so I could use null to indicate "has no value".
I still have to encounter the first case I really can take advantage of a
nullable value; maybe a long history without them made me develop patterns
that just walk around them ?
Regards,
|
|
|
|
|
Same thing, but with nullable type -- still not recommended practice though.
public struct Point
{
private int? _x,_y;
public int
x
{
get
{
if ( _x.HasValue )
{
return ( _x.Value ) ;
}
else
{
}
}
set
{
if ( !_x.HasValue )
{
_x = value ;
}
else
{
}
}
}
public int
y
{
get
{
if ( _y.HasValue )
{
return ( _y.Value ) ;
}
else
{
}
}
set
{
if ( !_y.HasValue )
{
_y = value ;
}
else
{
}
}
}
|
|
|
|
|
In my application I represent data stored in sql 2005 by "dundas" graphs. That data are dynamically updated. I want to refresh my graphs automatically.
|
|
|
|
|
Hello,
I'm pretty new to all this so i hope i haven't picked up the wrong end of the stick..
If you want the form to re-paint it's self then you can use then following method :
.Invalidate()
That will cause the control to re-draw it's self.
|
|
|
|
|
hello
can anyone help me
how can we find a *.dmp in a directory in c#???
thanks in advance
sachin
|
|
|
|
|
Directory.GetFiles(mypath,"*.dmp);
|
|
|
|
|
I guess you meant Directory.GetFiles(mypath,"*.dmp");
|
|
|
|
|
|
Hello every body,
I want to add items in combo box (drop down style sets to DropdownList)
with text and values.
I am able to add only text not its value.
Please help,
Regards,
rahul saini
|
|
|
|
|
A combobox list only holds text strings; to map these onto values, you can
rely on the SelectedIndex property (unreliable, in case the list gets changed)
or use a HashTable; if the text is in some way a string representation of the value,
you could also parse the text.
|
|
|
|
|
Hello Luc Pattyn,
Thanks for your rply,
Can you help me out how to use hash table.
Regards,
rahul saini
|
|
|
|
|
HashTable ht=new HashTable();
ht.Add("one", 1);
ht.Add("two", 2);
...
string s=myCombo.Text;
int myValue=(int)ht[s];
|
|
|
|
|
Hello Luc,
Thanx.
Can you send me any link from where i can get detail knowlede of hash table with examples.
Regards,
rahul saini
|
|
|
|
|
Hi,
there is a little Search box higher up on this page; did you ever try it ?
there also is MSDN documentation.
There are thousands of books on programming in general and on C# specifically.
And finally there is Google.
|
|
|
|
|
Hi!
Are you trying to specify its text? When activating the style DropDownList you have to set it by using the index of items existing in your combobox.
|
|
|
|
|
Hello,
I just want to specify the text and value in combo box
Regards,
rahul saini
|
|
|
|
|
comboBox1.Items.Add("hello"); // new value
|
|
|
|
|
Thnks for help,
But i want to add its value also
How to do that?
Regards,
rahul saini
|
|
|
|
|
a combobox holds and shows a list of strings, no more, no less.
|
|
|
|
|
Sorry, my previous message is wrong and Chintan.Desai is correct:
ComboBox can be loaded from a DataSource which can handle both a DisplayMember
and a ValueMember as the help on ListControl.DataSource explains.
|
|
|
|
|
Hey,
Try this link.As combo box gives property to assign the display string called as "Display member" and also help to stores its hidden values called as "Value Member" at each index.
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_ListControl_DisplayMember.htm#codeExampleToggle
nJoy.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|