Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: Progress Bar as Notify Icon Pin
Member 108502536-Mar-15 6:01
Member 108502536-Mar-15 6:01 
GeneralRe: Progress Bar as Notify Icon Pin
OriginalGriff6-Mar-15 6:07
mveOriginalGriff6-Mar-15 6:07 
GeneralRe: Progress Bar as Notify Icon Pin
Member 108502536-Mar-15 6:46
Member 108502536-Mar-15 6:46 
GeneralRe: Progress Bar as Notify Icon Pin
Member 108502536-Mar-15 6:45
Member 108502536-Mar-15 6:45 
GeneralRe: Progress Bar as Notify Icon Pin
Ron Nicholson6-Mar-15 8:38
professionalRon Nicholson6-Mar-15 8:38 
GeneralRe: Progress Bar as Notify Icon Pin
Member 108502536-Mar-15 13:48
Member 108502536-Mar-15 13:48 
AnswerRe: Progress Bar as Notify Icon Pin
Ron Nicholson6-Mar-15 6:43
professionalRon Nicholson6-Mar-15 6:43 
QuestionVery Strange Behaviour (for me) ...... Pin
Emanuele Bonin5-Mar-15 22:06
Emanuele Bonin5-Mar-15 22:06 
Hi All

There is a strange behaviour in my code ...
I have a TextBox where i handle Doubleclick and call a simple form that contain a calendar so i can pick a date from it.

When TextBox_DoubleClik create the form i pass the TextBox to Form's costructor.
The form have ONLY the MonthCalendar control and haven't control box (no close with X).
If i click outside the form an handler on form's DEACTIVATE event call this.close().

When i change a date on MonthCalendar, an handler on monthcalendar's DATECHANGED set the selected date to property TEXT of my TextBox and in my intention the form should be closed ... but if use this.close() i have the run.time error: System.ObjectDisposedException (i think that the error is referred by monthcalendar why ?)

the other, and MOOORE strange, behaviour is that if i add a couple of messagebox.show(...) before this.close() the first messagebox is IGNORED and the Exception is disappeared!!!

Can Anyone halp me to solve this misteries ???


Below some pieces of code from my project:

NB: txtBase is my class derived by TextBox

// This is the code tha i used to call my datepickerform
private void txtBase_OnDoubleClick(object sender, EventArgs e){
txtBase sd = (txtBase) sender;
txtBaseDatePicker DP = new txtBaseDatePicker(sd);
DP.Show();
}

// This is main code of my form with mnthcalendar control
public partial class txtBaseDatePicker : Form
{
private TextBox txtDate;
public txtBaseDatePicker(TextBox TB):this(){
txtDate = TB;
}
public txtBaseDatePicker(){
InitializeComponent();
}
// Handler of event DateChanged of monthcalendar (cal)
// this.cal.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.CalDateSelected);
void CalDateSelected(object sender, DateRangeEventArgs e){
MonthCalendar s = (MonthCalendar) sender;

// This.Close() throw an exception ....
// but if i active the following two lines the exception disappeare and the first
// MessageBox doesn't work!
//MessageBox.Show("MSG 1 (Absorbed)");
//MessageBox.Show("MSG 2");
this.txtDate.Text = s.SelectionStart.ToString().Substring(0,10);
this.Close();
}

void TxtBaseDatePickerDeactivate(object sender, EventArgs e){
this.Close();
}

}

PS: I solved "temporarily" with a timer that after 200 ms call this.close() but i dislike this trick ... in italy i say "This is not his Mother"!

modified 6-Mar-15 4:29am.

AnswerRe: Very Strange Behaviour (for me) ...... Pin
Richard MacCutchan5-Mar-15 23:13
mveRichard MacCutchan5-Mar-15 23:13 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Emanuele Bonin6-Mar-15 2:53
Emanuele Bonin6-Mar-15 2:53 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Richard MacCutchan6-Mar-15 3:02
mveRichard MacCutchan6-Mar-15 3:02 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Emanuele Bonin6-Mar-15 7:10
Emanuele Bonin6-Mar-15 7:10 
AnswerRe: Very Strange Behaviour (for me) ...... Pin
manchanx6-Mar-15 3:22
professionalmanchanx6-Mar-15 3:22 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Emanuele Bonin6-Mar-15 7:36
Emanuele Bonin6-Mar-15 7:36 
AnswerRe: Very Strange Behaviour (for me) ...... Pin
BillWoodruff6-Mar-15 4:51
professionalBillWoodruff6-Mar-15 4:51 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Emanuele Bonin6-Mar-15 7:29
Emanuele Bonin6-Mar-15 7:29 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
BillWoodruff6-Mar-15 13:20
professionalBillWoodruff6-Mar-15 13:20 
GeneralRe: Very Strange Behaviour (for me) ...... Pin
Emanuele Bonin6-Mar-15 20:57
Emanuele Bonin6-Mar-15 20:57 
QuestionGF(256) Multiplication Pin
Member 115029285-Mar-15 20:50
Member 115029285-Mar-15 20:50 
AnswerRe: GF(256) Multiplication Pin
Richard MacCutchan5-Mar-15 21:08
mveRichard MacCutchan5-Mar-15 21:08 
GeneralRe: GF(256) Multiplication Pin
harold aptroot5-Mar-15 23:12
harold aptroot5-Mar-15 23:12 
GeneralRe: GF(256) Multiplication Pin
Richard MacCutchan5-Mar-15 23:56
mveRichard MacCutchan5-Mar-15 23:56 
GeneralRe: GF(256) Multiplication Pin
harold aptroot6-Mar-15 0:04
harold aptroot6-Mar-15 0:04 
GeneralRe: GF(256) Multiplication Pin
Richard MacCutchan6-Mar-15 0:15
mveRichard MacCutchan6-Mar-15 0:15 
GeneralRe: GF(256) Multiplication Pin
harold aptroot6-Mar-15 0:21
harold aptroot6-Mar-15 0:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.