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

C#

 
QuestionVery Strange Behaviour (for me) ...... Pin
Emanuele Bonin5-Mar-15 22:06
Emanuele Bonin5-Mar-15 22:06 
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 
imho your design is doing a lot of unnecessary work, and you can simplify this easily; if you ask here, I'll show you another way to do so.

One way to increase the encapsulation of your objects is to expose/transmit only the "minimum" that clients of those objects need to have.

You pass an entire TextBox into your Form with a MonthCalendar. I propose to you that you don't need to pass anything to the Form with MonthCalendar.

Equally less-than-optimal, imho, would be to expose the entire MonthCalendar to the main Form.

imho, what is desired is that when your MonthCalendar's SelectionRange is changed, that it raise an Event ... which the Form with the TextBoxes has subscribed to, passing the SelectionRange, or whatever, back to the subscriber.

When the Form with TextBoxes gets the Event (callback), it can then easily insert whatever it has been passed (in the right form) in the current active TextBox.

Also, whether you use ShowDialog, or not, there's no need to create an instance of the Form with MonthCalendar every time you want to use it ! That's a total waste; it's so easy to re-use one instance of that Form.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"

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 
AnswerRe: GF(256) Multiplication Pin
harold aptroot6-Mar-15 0:24
harold aptroot6-Mar-15 0:24 
QuestionNeed Function to Redact SSNs and CCs from a string Pin
AnneThorne5-Mar-15 10:26
AnneThorne5-Mar-15 10:26 
SuggestionRe: Need Function to Redact SSNs and CCs from a string Pin
ZurdoDev5-Mar-15 10:43
professionalZurdoDev5-Mar-15 10:43 
GeneralRe: Need Function to Redact SSNs and CCs from a string Pin
AnneThorne5-Mar-15 10:56
AnneThorne5-Mar-15 10:56 
GeneralRe: Need Function to Redact SSNs and CCs from a string Pin
AnneThorne5-Mar-15 11:28
AnneThorne5-Mar-15 11:28 
GeneralRe: Need Function to Redact SSNs and CCs from a string Pin
AnneThorne5-Mar-15 12:10
AnneThorne5-Mar-15 12:10 
QuestionMessage Removed Pin
5-Mar-15 8:19
professionalN_tro_P5-Mar-15 8:19 

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.