|
kyledunn wrote:
Setting the value of properties in the constructor means they are now fixed at that value regardless of changes made in the property browser.
This is false. Setting values in the constructor will not do that. you need to set the value.
kyledunn wrote:
and it did not set the Name value to the default "tbx".
it didn't change it, because you never set it. the DefaultValue attribute is only for the IDE to know when it's been changed. It doesn't actually set the value. You have to set it yourself in the constructor.
kyledunn wrote:
but got this warning:
that warning is because you need to explicitly say whether it is an "override" or a "new". In this case, since the "Name" property is not virtual, you can only use "new".
All that said, it is a REALLY BAD IDEA to try to override the Name property. Controls do magic things with the name property to make sure they are unique. Making them all "tbx" would be a BAD THING.
|
|
|
|
|
Hi Andy,
I set the value of this.Width to equal 300 in the constructor for the custom textbox control and then changed it to 100 in the property browser. Upon running the form the textbox reverted to a width of 300 which led me to the false statement above. I just tried setting the value to any other number than it's original default and it worked as you described. The original default number was influencing the behavior I was describing.
Thanks for the explanation about the DefaultValue. That makes sense.
I agree it's a bad idea to change the default name. I was interested in changing the default, not necessarily getting rid of the sequential number, but it was a bad example to choose.
Thanks for your help.
Kyle
|
|
|
|
|
In moving over my code, I'm now to the MFC Wizards that we created.
We used to create a property page/sheet and call SetWizardMode to activate them, but alas, that feature is no longer in .NET
So, what is our replacement feature/procedure for this? I created a form, threw in a tab control, but could not find a way to hide the tabs.
Any thoughts?!
|
|
|
|
|
|
I read that one in my research and it really didn't tell me anything. Just a kludge work around.
But talking about kludges... I hid the tab controls under a panel and life is nice again. Kludgie, but nice.
I know there is a Wizard component available, but I really don't want to spend $160 just to hide a tab.
|
|
|
|
|
psdavis wrote:
I hid the tab controls under a panel and life is nice again. Kludgie, but nice.
Not bad. Did you set the tab position to bottom and added a panel with Next, Finish, Back etc. buttons?
|
|
|
|
|
Yep!
First off, changed the tab control to display tabs on the left.
Then, I added 4 panels total. One on top for the heading, one on bottom for the next/back, one on right for balance, and one on the left to cover up the tabs.
When I want to see the tabs, I send the left panel to back, when I want to hide them, I move the left panel to front.
Works pretty darn well.
|
|
|
|
|
Hi,
Does anyone know if there is a function in C# that will refresh a TreeView? I know this function existed in J++ but does it exist in C#? I want the jobs that get added to the node to be listed alphabetically without having to rebuild the tree again. If I quit the program and then reexecute it again -- they appear alphabetically.
If anyone knows how I might achieve this without having to rebuild my tree I certainly would appreciate. Thanks.
cAptHiDDeN
|
|
|
|
|
Just guessing...
MyTree.BeginUpdate( );
... (add nodes) ...
MyTree.EndUpdate( );
|
|
|
|
|
I'll tried that before -- close but no cigar. Anyone else know if this is a bug? It would certainly be nice if these were sorted. I am sure someone will figure it out eventually. Let's all hope so.
cAptHiDDeN
|
|
|
|
|
I am using the tree at this very moment and it refreshes just fine on it's own alphabetically. I think you must be creating the nodes wrong or something. Do you have the sorted property selected to true? It works just perfect though.
anyway peace
|
|
|
|
|
Damn...all that I had to do what change the sort property from false to true. I just hate it when its something that simple -- and you think it would be something more complicated. It would have been nice if J++ version 6.0 was this easy!!! hehehe
Thanks for the help.
cAptHiDDeN
|
|
|
|
|
Curious if anyone's heard when the next version (or service pack) of .NET/C# is due? And does anyone know of anything new that will be in it?
Thanks!
|
|
|
|
|
Hi all,
In Java swing, JTable lets users modify the content of each cell and different types of construct can be associated with each table cell, eg. a drop down list, string and so on. So it is extremely flexible.
Could anyone please tell me if there is similar class available on C#? I have searched the internet for a long time and couldn't find one. Is there any workaround to handle this situation?
very much appreciated.
Wilson
|
|
|
|
|
it's the DataGrid control.
|
|
|
|
|
I want to extend a control (MenuItem, to be specific). But I want Visual Studio's Windows Forms Designer to use my new control (call it MyMenuItem) instead of MenuItem when using the Designer to create a MainMenu.
How does one do this?
Thanks in advance!
Steve
------------------------------
steve@crozier.com
|
|
|
|
|
Unless the MainMenu designer has this feature in there already you'll have to create your own MainMenu type class and designer so that it creates MyMenuItem s instead of MenuItem s.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I am porting some code from c to c# and the original code makes a lot of use of #define macros - is there an equivalent in c# - at the moment I am turning the macros into fuctions but it I am wondered about the performance aspects of doing this
|
|
|
|
|
There is no equivalent to macros in C#
Creating them as functions should work well; the JIT does a good job of inlining such functions.
|
|
|
|
|
thanks eric (got your book by the way )
what about optimisation? I am doing a lot of bit wise operations and rotations in 8,16, and 32 bit blocks
at the moment I have
private static uint ROL(uint x, int n)
{
return ( ((x) << ((n) & 0x1F)) | (x) >> (32-((n) & 0x1F)) );
}
private static uint ROR(uint x,int n)
{
return (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F))));
}
would these be optimised to IL equivalents or would I have to drop to some IL layer eg is there an equivalent of _asm
Holy Handgrenade of Antioch instructions
|
|
|
|
|
You could consider compiling the library with Managed C++, and making wrapper-classes to the library, it might save you a lot of work. Managed C++ seems quite able to cope with plain C.
|
|
|
|
|
true - but that wasn't the point - the point was to convert from c to c# and learn the syntax differences between the 2 languages - a lot of places don't like mixing languages and like to concentrate on just 1 language across all layers - sad but true - I had the same problem with COM - I'd say but it is COM each side shouldn't care what it is written in as it has a binary interface layer and they'd say but it is written in VB (or ATL) and we don't use that here we use ATL (or VB)
according to MS they expect people to be using VB, C# or J# (according to an article I just read 33% in each block) and already I am hearing people say but we don't use C#.NET we are using VB.NET only
|
|
|
|
|
Hello Friends,
I want to open Outlook Express from within my application. Thats why I'm using following statement for the same :
System.Diagnostics.Process.Start("mailto:"+toNames+"?Cc="+ccNames+"&Bcc="+bccNames);
But it is giving me following exception:
"An unhandled exception of type System.ComponentModel.Win32Exception occured : The specific module could not be found"
Can anybody suggest what could have been the problem???
Outlook Express is indeed installed on my PC.So, what could be the reason of not finding the specific module or getting the exception.
Thanks in advance.
Pranoti
|
|
|
|
|
|
Kind of a quirk. Does not work while running the program in the compiler (in visual studio). But should work after it is built into an executable. Trying running the code as an executable.
|
|
|
|