|
Hey Madhuri!
http://dotnetuser.www2.dotnetplayground.com/[^]
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
Paraphrased from TMNT:
"Cricket? You have to know what a crumpet is to understand Cricket."
|
|
|
|
|
Hi! I am glad you found me here!
Madhuri Mittal
|
|
|
|
|
Did anyone have the same experience in C# Winform application that you have a form can not be closed? I wonder what would be the possible reason for that?
Thanks.
|
|
|
|
|
Probably catching the Closing event and setting e.Cancel = true .
|
|
|
|
|
There is a known bug where if a control that has focus is removed from the parent form, the form will not be able to close.
The bug may have been more specific in that the control had to be inside of another control, but I can't remember (ie Form A has control B, which has control C; control C has focus and is then removed from B. Now A can't close). I do remember that the example to reproduce the bug had this set-up, but I can't remember if it was a requirement.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
I want to create a non-visual component that manipulates the form it is dropped onto. Is there a way to access this form from within the component?
Victor
|
|
|
|
|
derive your class from Component , then it can appear in the toolbox, but when dropped into the form, appears in that little bar, like when you add an imagelist object (presuming you have vs.net). and can be accessed from the form.
| Website: http://www.onyeyiri.co.uk
| Sonork: 100.21142 : TheEclypse
| "If a dolar was a chicken would the chicken be evil?"
|
|
|
|
|
not without telling the component what form it is attached to.
this is because most Components can be used from anywhere, not just forms.
that said, I also found this to be a useful idea, so I made a subclass of Component, FormComponent, which i talked about in this blog entry.
This component has a property which points to its Form, when dragged onto a form by a designer. no code required.
|
|
|
|
|
Hello,
Where are the tlbimp.exe and Ildasm.exe utilities located or can be downloaded from? I have done a search of my computer and they do not seem to be installed.
Thanks
|
|
|
|
|
Default Installion in
\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin
|
|
|
|
|
If you have Visual Stuido .NET installed (and used the default path) they are in C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin If you don't have Visual Stuido .NET then you need to download the Framework SDK
If you want to use them you can just open up the Visual Studio .NET Command Prompt
- monrobot13
|
|
|
|
|
Thanks. Found it. However, it wasnt found when I did a search for it.
|
|
|
|
|
When I attempt to use custom DLL that was written in Visual Foxpro (works fine in VB6, Foxpro 7, and Delphi 7) in C#, I get an error that cannot convert string to ref object. I tried to use the DLL without running thru tlbimp and with running it thru tlbimp and I get the same results.
If I call MyClass.Myfunction("johndoe", "12345") I see in the intellisense Myfunction(ref obj name, ref obj password).
I thought I read somewhere That I may have to edit this with Ildasm and change it.
????
Thanks.
|
|
|
|
|
try adding the ref keyword in front of your parameters
- monrobot13
|
|
|
|
|
can it be done in C#? I don't even know if it is a bitwise operation. Any help, I'm new to programming and would like to use the helpful feature.
const ulong VOLATILITY_DISPLAY_PERFORMANCE =1;
const ulong VOLATILITY_DISPLAY_STANDARDDEVIATION=2;
const ulong VOLATILITY_DISPLAY_ARITHMETICMEAN =4;
const ulong VOLATILITY_DISPLAY_EFFICIENCYINDEX =8;
const ulong VOLATILITY_DISPLAY_SHARPE =16;
const ulong VOLATILITY_DISPLAY_VARIANCE =32;
const ulong VOLATILITY_DISPLAY_ALPHA =64;
const ulong VOLATILITY_DISPLAY_BETA =128;
const ulong VOLATILITY_DISPLAY_TREYNOR =256;
long value = VOLATILITY_DISPLAY_PERFORMANCE + VOLATILITY_DISPLAY_SHARPE;
/8it throws a compiler error for next line*/
if(value & VOLATILITY_DISPLAY_SHARPE) /* == TRUE */
{
/*DO SOME THING*/
}
|
|
|
|
|
You could try the Framework's BitArray class.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
You could try this, convert value to a ulong and in your if statement use Convert.ToBoolean () to convert the value & VOLATILITY_DISPLAY_SHARPE to a boolean:
ulong value = VOLATILITY_DISPLAY_PERFORMANCE + VOLATILITY_DISPLAY_SHARPE;
if(Convert.ToBoolean(value & VOLATILITY_DISPLAY_SHARPE))
{
}
- monrobot13
|
|
|
|
|
I think an enum is better suited for this, after all you are grouping a series of constants that can all be used for the same thing.
Also, in C# a long is 64-bits and ints are 32-bits so you probably won't need a ulong (judging by your code anyway).
Now a little code:
[Flags()]
public enum VolatilityDisplay
{
Performance = 1,
StandardDeviation = 2,
ArithmeticMean = 4,
EfficiencyIndex = 8,
Sharpe = 16,
Variance = 32,
Alpha = 64,
Beta = 128,
Treynor = 256
} Just a quick note about the [Flags()] bit. This is basically telling the framework that the values in this enum can be used in bitwise operations. Now to get on with the rest of your question.
VolatilityDisplay value = VolatilityDisplay.Performance | VolatilityDisplay.Sharpe;
if( (value & VolatilityDisplay.Sharpe) != 0 )
{
} Two important things to note here:
1) When you wish to set two different bits you should use the bitwise-or (| )operator and not addition. The reason is that the addition won't do what you think if the bit is already set.
Take for example the bitvector set to VolatilityDisplay.Performance | VolatilityDisplay.StandardDeviation the integer representation of this is 3. Now you want to make sure that VolatilityDisplay.Performance is set. If you use the addition operator (+ ) then you are really performing 3 + 1 = 4, which if you look at the meaning of 4 in the list above it comes out as VolatilityDisplay.ArithmeticMean . Now neither of the values you wanted are set and one you didn't want is set.
2) The second part is that unlike C/C++, if statements require whatever you are testing to actually be a bool and not simply a zero/non-zero value. So you have a couple of different options, the one I used above, which is just testing to ensure a non-zero value was returned. The other is the one that someone else suggested which is to use Covert.ToBoolean. Both do pretty much the same thing, so its up to you which you want to use.
Hope that clears some things up for you,
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
Hi,
I am a novice to .NET. I want to develop a sample for Pocket PC mobile application. I have a COM DLL with me. Using this DLL, i want a sample wherein I want to call the methods of the DLL.
Please kindly let me know
1)how to develop a mobile application?
2)How to add the COM DLL to the sample?
3)How to call methods of the component?
4)How to execute the sample?
I am in urgent need of this sample. Please reply me soon.
Waiting for ur reply eagerly...
Your help would be appreciated.
Thanks in advance.
|
|
|
|
|
Is there any way to change the text of MessageBox buttons?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
It can only be changed to the predefined buttons in the MessageBoxButtons enum. Taking a peek at the underlying Win32 MessageBox function it doesn't have that ability either. At least it wasn't apparent from the docs.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
How do i write a multi threaded client in C#, which will enable a client to communicate with multiple servers?
hoping for a reply...
novice
|
|
|
|
|
|
Assume i have developed a module using a system & my friend is writing a client for the same in another system. Now he wants to add a reference to the object that was created by me & he wants me to make it available to him as a web refernce. How do I go about doing this?
hoping for a reply...
novice
|
|
|
|
|
Hello all,
I am developing an application, which helps make PDF documents. I have provided a RichTextBox for text entry and I have used my own context menu for this RichTextBox, which allows for changing font, italise/bolden the text etc. Right now I want to figure out a way to get the formatting information of the text, like which portion of the text has what font, if its italicised, boldened, bulleted, underlined etc. If I am right, I will have to parse the RTF and get this information. How do I go about doing this? Are there any easy ways to accomplish the task ? Or is this totally impossible ?
Thanks
Smitha
It is better to be hated for what you are than to be loved for what you are not.
-- Andre Gide
|
|
|
|