|
Not really so complicated - he just makes it look complicated with his loony formatting . However, I gave him a lolly because it's a very good answer.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Ok, now, that's an answer . And now here's a question, what if SomeMethod's signatures does not match the delegate signature?? Do I get an ArgumentException?? I know this should be a problem since he knows the signature of the method. Just asking out of curiosity.
|
|
|
|
|
Just tested that. I inserted another parameter before the normal first parameter (which is the name of a file), then called the function. The int value returned by the function is an error code, now the result was 1. According to the documentation of the manufacturer "1" means "File access error", i.e. my first parameter (although it was an int) was treated as the expected parameter (a string denoting the file name), and extra parameters seem to have been discarded.
In summary, you do not get an exception, the function just executes (and may happen to return an error code or destroy your system).
|
|
|
|
|
Thank you
|
|
|
|
|
Hi,
I made a web browser in .net c# windows application. In that how can i change appearance of the win form...like changing skin of the browser. How can i archive this using c#.
Thank you.
krishna
|
|
|
|
|
Man, you're writing in your question, that this is WinForms question, so why don't you ask it on WinForms forum?
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
lukasz_nowakowski wrote: Man, you're writing in your question, that this is WinForms question, so why don't you ask it on WinForms forum?
He wrote it in C#, why should he ask it in the Windows Forms forum then and not here in C#?
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Because he doesn't ask about feature of the C#, only about a feature of the Windows Forms. If he knew how to do it in Visual Basic, but had a problem translating it to C#, it would be a good place to ask, but he asks (not sure how to do it, so I'm guessing here) for a method or property, that manages apearance of Windows Forms control.
Following your thinking, CodeProject forum should be truncated to C#, Visual Basic, C++, PHP, ... (hope you see the pattern here). And when someone has a problem with Windows Forms or ASP.NET, he has to search in all languages instead of just searching forum more specific to his needs.
That's why I think, this question should go to Windows Forms, not C#.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
i want that my prefix or my first 4 char value in my textbox which is "SPR-" cannot be deleted or modify by the user...how to code that.. plz.
|
|
|
|
|
One would assume that you are going to do “something” with the contents of the TextBox after the user has finished entering data into it; in which case, if the data does not have an “SPR-“ prefix, add it after the fact.
|
|
|
|
|
Use a MaskedTextBox[^] instead, and set the mask to "SPR-&&&&&&&&&&&" where the number of '&' characters equals the max length of the input.
You can remove the underscore by setting the PromptChar property to space.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Hi,
I have a function which can add custom column types to my table.In that there is a provision to delete the columns also.So when deleting my column i need to check whether this column contains any data or not.How to do this>
Seeism
|
|
|
|
|
HI,
SELECT @vCount=('select COUNT(['+@v_COLUMN_NAME+']) from '+@DataTable)
print @vCount
This is my stored procedure part to find the count of a column specified.But here i m getting a conversion error
vCount is declared as int
|
|
|
|
|
I think that you may stand more chance of getting an answer to this if you post in the Database forum.
|
|
|
|
|
Hello,
I was wondering whats the proper way to name your global variables.
I use Visual Studio 2010, and I use two add-ons: ReSharper and Stylecop, to learn how make better code.
However, their advises are conflicting.
For example, if I'd have this code:
public class Example
{
private static object _staticExample;
private const object CONSTEXAMPLE = null;
private object normalExamle;
public void main()
{
this.normalExamle = "";
normalExamle = "";
}
}
(1): How am I suppose to call this? ReShaper tells me it should be _lowerCamelCase, however Stylecop tells me to not start with an underscore[^]
(2): What about all capital constants? I see them all the time. However ReShaper tells me it should be UpperCamelCase. Stylecop does not care about casing or it being full capital, only that the first letter is a capital.[^]
(3): How am I suppose to use the variable? Stylecop says I'm suppose to use this. (3.1)[^] However, when I do that ReShaper says this. is redundant, and that I should remove it (3.2).
Whats the right way to do this?
Thanks
|
|
|
|
|
I use what the Framework uses, "Pascal case"
DataTable , DataSet , BackColor , StreamReader
As it's the de-facto best practice.
However, so long as the code in your company is consistently using their style,
Then you're much better off getting used to it.
If every developer has their own standard, then there's no standard at all.
please have a look here
http://www.akadia.com/services/naming_conventions.html[^]
I know nothing , I know nothing ...
|
|
|
|
|
Different tools have different rules, some even allow you to change these.
Personally I agree with "_" rule on point 1 (as does Microsoft I *think*, it definately did at one point, but there is a glimmer of a memory that they may have changed their collective mind).
Capitalised Constants are probably a hangover from either Java or c++, we used to use CONST_EXAMPLE in c++. Microsoft suggests you use the CamelCase for these.(or I might have set up a rule in FxCop to do this).
Personally I use FXCop for this, work as it is the MS tool to do this.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
That's not global; it's private.
I don't use underscores, and I use lowercase for private members.
I suspect that the UPPERCASE habit is from C #defines.
|
|
|
|
|
Hi guys.
I wanna know if I add a windows.forms reference in my web project and use
System.Windows.Forms.SystemInformation.PrimaryMonitorSize
its a good thing.
or javascript window.screen.width its more recommended to web projects?
|
|
|
|
|
Managed code will run on the server, not the client; and it is likely to fail, as there is no user logged in, hence no primary monitor is known.
|
|
|
|
|
oh right!!
thanks dude
|
|
|
|
|
hi all
is there any 64bit hashing algorithm implemented in .net?
i am using .net 3.5 and need to encrypt a string with length of 3 to a byte array of length 8 or 10
for example :
hash("ABC")="!@?{%ER)@w"
any suggestion?
|
|
|
|
|
Take the first half of the MD5 hash. I don't know how many collisions it will create or if they are uniform but it may work?
|
|
|
|
|
hi
no i need a class implemented in .net some thing like MD5 Class .
but it have to generate byte array of length 6 to 10 (not 16 byte or higher).
|
|
|
|
|
I would read my post again. Last time I checked 16/2 = 8.
|
|
|
|