|
Please do not cross-post in multiple forums.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
iwant to have a masked textbox that add separator for digits when textbox is changing it means i want to have separators after enter each digit not after leave textbox
thanks alot
|
|
|
|
|
did you try typing "masked textbox" in the search facility on CodeProject ?
It is a good subject !
Luc Pattyn
|
|
|
|
|
hi all,
I had develop a user control to display chart in real time without flickering(using buffered Graphics).Now i am facing problem that the graphics(chart) will erase when the prompt box move over the area of display chart. My question is, how can i prevent chart from erase when prompt box move over it?
May be my question is abit confusing, if anyone would like to give me a hand to slove this problem, i will send you a exe file to test the problme(please give me yours email add).
Any hits are welcome..
thanks in advance,
cocoon
|
|
|
|
|
Hi,
Send me the file if you will, I will study it
|
|
|
|
|
hi,
thank you for ur reply,can u please send me u email add? i would like to send u my example program for testing purpose.
thanks in advance
cocoonwls
|
|
|
|
|
|
I have a generic Cancel button on my form. Various bits of code tell the button what to do when clicked, by setting a handler for that control.
When a new handler is set, I'd like to remove the old handler. How can my code detect the handler for any given control, so that I can remove it?
The button has a "no handler" state, too, where it currently has no function. So, I can't just stomp the control with a new handler every time, I need to be able to remove it, too.
So - how do I "get" the handler for a specific control?
|
|
|
|
|
The only things you can do to an event are add or remove a handler (with += and -=);
I know of no way to read or clear it directly.
So the only solution I can see is you remember what got added in another object,
such as an ArrayList, in order to undo it at will.
Luc Pattyn
|
|
|
|
|
"You make me very sad."
Thanks, Luc. Tell me, what does happen if I simply add another handler? Does it destroy the old one? Or do all the handlers get called for each event?
|
|
|
|
|
JoeRip wrote: "You make me very sad."
That's MS, not me I believe.
JoeRip wrote: Does it destroy the old one? Or do all the handlers get called for each event?
The latter, the += really means "add listener".
BTW: A common mistake is adding the same handler over and over, and not noticing
it now gets called multiple times. (Not for a KeyPress of course, but for things such
as Focus)
Luc Pattyn
|
|
|
|
|
A list of EventHandlers is maintained (See Visual docs "Defining an event" for an example.
Also check out the RemoveHandler method.
Good luck
Theres light at the end of the tunnel, hope it ain't no train.
|
|
|
|
|
I believe you are confusing VB and C#. There's no RemoveHandler that I can see for C#.
|
|
|
|
|
Well, yes there is, but it is in System.Web.UI.Control
not in System.Windows.Forms.Control
and I am not familiar with it.
Luc Pattyn
|
|
|
|
|
Mikeh32217 wrote: A list of EventHandlers is maintained (See Visual docs "Defining an event" for an example.
Also check out the RemoveHandler method.
I'm confident there is no RemoveHandler method for Windows.Forms.Controls for C#, since it uses the "-=" syntax to do this.
And there's no topic "Defining an event" in MSDN...
However, if there's a list maintained somewhere of all of the handlers, I would love to know more about this. Can you provide some data here?
|
|
|
|
|
It seems I've put my:-> mouth in motion before putting my brain in gear! sorry...
In an App type this.Events you should see a RemoveHandler and this.Events[] gets you the list but I'll have to do more research on this subject.
Also I got to "Defining an Event" (sometimes repeating your steps at getting at a subject is harder than finding it in the first place)but if you look up EventHandlerList you will see the article in question.
Good luck
Theres light at the end of the tunnel, hope it ain't no train.
|
|
|
|
|
Maybe something like this should work:
public partial class myButton : Button
{
public myButton()
{
InitializeComponent();
}
public event ClickHandler Click1;
public delegate void ClickHandler(EventArgs e);
public myButton(IContainer container)
{
container.Add(this);
InitializeComponent();
}
protected override void OnClick(EventArgs e)
{
if (null != Click1)
Click1(e);
base.OnClick(e);
}
public bool HasListener
{
get { return (null != Click1); }
}
}
|
|
|
|
|
I want to corresponding data from first datagridviewcomboboxcolumn to second datagridviewcomboboxcolumn. i am trying but all data r going to be clear except current one. please help me with code. thanks
masud
|
|
|
|
|
How to manage an event like OnClose, to do some actions before the moment some UserControl close.
I need to have a way to cancel Closing.
Thanx.
|
|
|
|
|
The cancel has to be done at the form level and you use the OnClosing and setting the e.Cancel property to true.
Good luck!
Theres light at the end of the tunnel, hope it ain't no train.
|
|
|
|
|
So, I handle OnClosing for a Form, and check all UserControls, belonging to the Form, for some state. If the state is not "right", I set e.Cancel to true.
Ok...
But how I can reach all UserControls belonging to the Form if I have nested containers like TabPages and Panels?
|
|
|
|
|
hi friends i have a open book exam after 3 hours please help me by introduce me exam sample ...(my exam difficulty is in beginner mode)
thanks a lot.. it is university exam and you can bring your refrenece to exam for look it ...
|
|
|
|
|
So, now that you failed your exam, after asking for help over and over, what have you learned for next time ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hopefully that open book exams are an order of magnitude more difficult that closed book exams in order to make up for the fact that reference material is permitted in the exam.
|
|
|
|
|
hi friends i have a open book exam after 3 hours please help me by introduce me exam sample ...(my exam difficulty is in beginner mode)
thanks a lot
|
|
|
|