|
Mostly, you'll see, what you want to do, is based on the available screen space in a row of a table. Like the Subject field in Outlook when you open your Inbox and have all your messages listed in the right pane, the column the Subject is displayed in can be any width. That width is dependent on the width of the column and the size of font it is displaying.
But, in either case, be it on-screen or simply a maximum number of characters, there is no formatting expression that will cover the functionality you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Mostly, you'll see, what you want to do, is based on the available screen space in a row of a table. Like the Subject field in Outlook when you open your Inbox and have all your messages listed in the right pane, the column the Subject is displayed in can be any width. That width is dependent on the width of the column and the size of font it is displaying
Yep. I understand that... I've wanted to do things like that in the past and have had to do it manually which isn't a problem.
Dave Kreskowiak wrote:
maximum number of characters, there is no formatting expression
yeah. It's a pain.
Regards,
Brian Dela
http://www.briandela.com IE 6 required. http://www.briandela.com/pictures Now with a pictures section http://www.briandela.com/rss/newsrss.xml RSS Feed
|
|
|
|
|
Does someone know where I can find a good explaination of message handling in C#? i.e. how do the PreProcessFilter and WndProc methods work?
Initially I thought that everything in the windows enviroment is plugged into a central message system and PreProcessFilter selects which messages are relevant to a control or form and this gets passed into WndProc and handled. But now I don't think that's right.
Here's an example of what I'm doing. I have a windows form that overrides CreateParams so that it shows like a tooltip or context menu, it won't take focus or activation so I can't use the LostFocus event to close the window when I click off of it. So I figured I would have to override something in the messaging system to do this but I'm a little lost. any ideas?
thanks,
Jesse
|
|
|
|
|
|
|
hey!
i try to make a keypress event. but i dont know the (char) they have on the keyboard. and i dont find it on google *shameonme*
can anybody help? thx
|
|
|
|
|
In a KeyPress event you cannot detect the arrow keys. Instead, use the KeyDown event. Then, in the Keydown event,
if (e.Keydata = keys.up){
...
}
BTW, the KeyCode for the up key is 38.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
What do you understand under an assembly? All I know about it is when .Net code is compiled into Microsoft Intermediate Language and stored in a file called an assembly. Is there more to it? Or don’t you really worry about it?
|
|
|
|
|
An assembly consists of a manifest. That's really all that's required. If can have zero or more of modules (contains the IL), embedded resources, dependencies, files (not currently supported by the C# compiler), external references (to native modules for P/Invoke) and assembly-attributes.
If all you're doing is compiling a project in VS.NET, you really don't need to worry about it.
There are more advanced things you can do if you understand the assembly, versioning, etc. You can find more information in the .NET Framework SDK, such as assembly version redirection, satellite assemblies (specific to a culture but contains no modules), etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I understand "assembly" as "a module or a group of modules that is treated like a logical unit".
Usually an assembly is one file that contains one namespace.
You don't have to care much about the official definition...
|
|
|
|
|
Corinna John wrote:
Usually an assembly is one file that contains one namespace.
An assembly can - and typically does - contain more than one namespace, and namespaces can span assemblies. Technically, namespaces have nothing to do with it. A module within an assembly doesn't even have to use namespaces (the C# language doesn't support this) at all.
Maybe for a tiny application you could do this, but larger projects should not restrict a namespace to an assembly. First of all, it may not work out anyway, and it will probably create too many assemblies (or you have too many classes in a namespace and should probably organize classes a little better, though that's an architectual choice).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How do we compare objects in C#, If I want to compare I would write
bool equalob(object that)<br />
{<br />
if(that == classname)<br />
{<br />
return true<br />
}<br />
else<br />
{<br />
return false<br />
}<br />
}
Is this fine.. I got error..
in java we might say
(hat instanceof classname)
wats in C#.
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
saud_a_k wrote:
(hat instanceof classname)
instanceof is is is C# (and it compares types, not objects):
if(that is Class)
|
|
|
|
|
ok.. I tried Implementing is , but..
ok it is like
I have a class.,.. say class1 which has a method objeq(object that)
it returns true or false depending on
if( that is class1)<br />
...true<br />
else<br />
...false
now.. another class uses this class .. lets say a completely new application uses the dll of this class..
From a method made of the using class, I cannot get the objeq function after the dot (.)
like say
using class1;<br />
<br />
class class2<br />
{<br />
Public static void main(string [] a)<br />
{<br />
class1 o = new class1;<br />
o. ....(nothing!! I don't get objeq)
}}
Why?
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
Are you sure that objeq is public?
|
|
|
|
|
Yes Yes! sure.. everything is public as yet.
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
Maybe it has somethin' to do with the interface iv'e used.. I thought it would be the same
so
I made an interface inter
then my class1 implements it like
class1 : inter
these two are dlls
I have another application using both of them and the class1 has objeq function.
The function is not defined in the interface.. ( so nothings wrong.. I think)
but it should work..
why don't I get the objeq arter the (.)?
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
What Corinna said was right, except that the RHS of is must be a reference type. For any type, you could use if (that.GetType() == typeof(AnyType)) .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
see here in C# we have Equal method to check this.
bool Object.Equal(object obj) >>signature
this will determine that System.object is equal to the specified System.Object.And if both objects are same it will return true otherwise false.
your eg :
Object1.Equal(Object2);
this is one of easyest method.
Another method is Implementing IComparable interface. And this interface have only one abstract method called CampareTo(). you have to over ride this method in the type whose implementing this Icomparable interface.
you will get nice explanation and example for this in MSDN.
Please feel free to contact.
Sreejith S S Nair - Bangalore
|
|
|
|
|
insead of object2 in Object1.Equals(Object2) can't I put a class..
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
No, only objects (unless you're comparing to Type s). As Corinna and I both said, use if (obj is SomeType) or if (obj.GetType() == typeof(SomeType)) , depending on whether or not SomeType can be a value type.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Actually, the static Object.Equals determines if two reference variables refer to the same object. For value types, this depends upon their values.
The default virtual instance method, Object.Equals , also performs the same as above except that derivative types (and everything derives from Object ) can override Equals and provide their own implementation, but a type doesn't have to override it.
You're right about IComparable , though. If an object implements this interface, it should be used instead. This can be done easily by using the Comparer in the .NET FCL. This will check for an IComparable implementation, otherwise it will revert to a virtual call to Object.Equals .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanx Mr. Stewart but I have to compare an object to see wether it is an instance of a class..
I have replied to the above post please see.
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
And that's EXACTLY what Corinna and I told you how to do.
object obj = "This is a string variable.";
if (obj is string)
Console.WriteLine(obj.ToString());
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I don't want to compare a string!
I want to compare a class..
ok as said above it worked without an interface but
See the above post ...
PLEASE..
I know you can help.
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|