|
No unfortunately no. I developed a small macro to declare the constants for me.
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
Would you be willing to publish the macro? It would be nice that have available...
|
|
|
|
|
I have a Web User Control (.ascx) that can use either a SqlDataAdapter or a OleDbDataAdapter if I change the type of 1 of my members and 1 property
I'd like to be able to do this via some sort of typing - rtti
is this possible in c# - I'd hate to have 2 or more copies of what is essentially the same control.
PS yes I did look to see if they shared a base class - which they do but the properties I need to access aren't in the base class but have identical names in SqlDataAdapter and OleDbDataAdapter eg InsertCommand , UpdateCommand
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
my mistake - I found it in an interface - I did think it was odd
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Although you can use an interface in this case, I agree, I how that Microsoft chooses to incorporate templates in the next revision of the .NET environment.
This would be especially useful when you want to make strongly typed collections classes.
Check out this .NET collection generator: http://www.sellsbrothers.com/tools/#collectionGen
Also the MagicLibrary has a nice Collection Base that supports events: http://www.dotnetmagic.com
Sorry about ranting about collections....
|
|
|
|
|
Hello,
I have the following proglem: I would like to unload the control from the form. After it's removal from Controls collection I cannot close the form - it simply does not work. The Dispose method does not get to be called. Just as there was no proper cleanup done. However, the Dispose call on the control does not help. Does anyone an idea how to manage this, to my surprise not easy, task?
All it is done in .NET using Windows forms.
Thanks in advice
Vasek
Vasek
VB6, C#, MS DNA, MS .NET software developer
|
|
|
|
|
Are you doing something 'fancy' before. If I create a form add a button and have that button remove itself from the controls collection it removes the button as expected. Also it will let me close the form without any problems
Regards
Rutger
|
|
|
|
|
The problem is somewhere else than in unloading the control. It works OK.
The problem is somewhere else. Luckily I found the way how to mitigate it!
Vasek
VB6, C#, MS DNA, MS .NET software developer
|
|
|
|
|
Here is a problem description and a work around; don't know if this is the same work around you're using though.
http://www.jelovic.com/weblog/e41.htm[^]
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Yes, it is like my problem. From within an control I want to remove i catch the event for removal request. That event is handled in the form and the control is removed upon this request.
I thought there could be problem with code sequence. Because after I handle the event in which I remove the control from ControlCollection, the flow of control returns to the control which was intended for removal (because it is demanding to be removed).
I will try you workaround and see.
Thank you very much.
Vasek
VB6, C#, MS DNA, MS .NET software developer
|
|
|
|
|
How do I know which row in the rich text box has the focus now?
Say I am overriding WndProc and checking for WM_KEYDOWN I'd like to figure out which row in the rich text box the cursor is curently located.
I dont mean the screen row [if it has scrolled down quite a bit, the 3rd visible row on screen might actually be the 44th row] I want the actual row here because I want to get that line of text using the Lines property but for that I need to know the index of the row
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Try counting the newlines (ie "\r\n")?
I think that should work...
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
Nishant S wrote:
But till where do I count them? I have to know where the current pointer is right?
Use the selectionstart property.
----------------
Quote from MSDN:
Gets or sets the starting point of text selected in the text box.
[C#]
public int SelectionStart {get; set;}
.
.
.
Remarks
If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position will be placed after the last character. When text is selected in the text box control, changing this property may decrease the value of the SelectionLength property. If the remaining text in the control after the position indicated by the SelectionStart property is less than the value of the SelectionLength property, the value of the SelectionLength property is automatically decreased. The value of the SelectionStart property never causes an increase in the SelectionLength property.
Note You can programmatically move the caret within the text box by setting the SelectionStart to the position within the text box where you want the caret to move to and set the SelectionLength property to a value of zero (0). The text box must have focus in order for the caret to be moved.
--------
The SelectionStart property should return the current position in the RichEditBox.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I have a class derived from the System.Windows.Forms.TextBox .
I have overridden TextBoxBase.OnModifiedChanged but it never gets called even when I change the text in the text control
Has anyone else experienced the same problem?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Hi,
I was not able to find the option for PostBuild Action in the C# Project Properties.
(Where I can Specify some Dos commands to run after the project is Compiled)
Is there any alternative feature avaliable?
Thanks,
FiroZ
|
|
|
|
|
FiroZ wrote:
Is there any alternative feature avaliable?
You can add an empty Visual C++ project and then do post builds from that project. Just make sure that the empty C++ project is built last in the solution.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
MSDN has a BuildRules visual studio addin. It lets you add pre and post build commands to solutions and projects.
can't find the link right now... but i know it's on there somewhere
|
|
|
|
|
|
|
|
Some example code would be nice Cant seem to work it into a form, seems a bit messed up
And why does people write controls without default constructors?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info. 
|
|
|
|
|
Card[] crds = new Card[3];
crds[0] = Card.New("My Text", 0);
crds[0].Font = new Font("Times New Roman", 10, FontStyle.Bold);
crds[1] = Card.New("My Text", 1, CardShape.Circle);
crds[1].Shadow = false;
crds[2] = Card.New("Solid Colours", 1);
crds[2].CardUp = Color.SkyBlue;
crds[2].CardOver = Color.SteelBlue;
crds[2].CardDown = Color.Navy;
CardCtrl crd = new CardCtrl(crds);
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
"All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
leppie wrote:
And why does people write controls without default constructors?
Because they don't have VS.NET or they use MC++ to test it so they don't realize how important the default constructor is to the forms designer
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|