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

C#

 
GeneralRe: desable a menustrip item [modified] Pin
phil.o21-Dec-10 6:07
professionalphil.o21-Dec-10 6:07 
GeneralRe: desable a menustrip item Pin
fjdiewornncalwe21-Dec-10 9:59
professionalfjdiewornncalwe21-Dec-10 9:59 
GeneralRe: desable a menustrip item Pin
phil.o21-Dec-10 21:28
professionalphil.o21-Dec-10 21:28 
GeneralRe: desable a menustrip item Pin
musefan21-Dec-10 6:31
musefan21-Dec-10 6:31 
GeneralRe: desable a menustrip item Pin
fjdiewornncalwe21-Dec-10 9:51
professionalfjdiewornncalwe21-Dec-10 9:51 
GeneralRe: desable a menustrip item Pin
musefan22-Dec-10 2:29
musefan22-Dec-10 2:29 
GeneralRe: desable a menustrip item Pin
fjdiewornncalwe22-Dec-10 3:35
professionalfjdiewornncalwe22-Dec-10 3:35 
GeneralRe: desable a menustrip item Pin
musefan22-Dec-10 4:06
musefan22-Dec-10 4:06 
But then if there is multiple forms that can open forms 2, 3 and 4 then they are likely to have a different UI, which means different properties in your static class and therefore you still have to update code in Forms 2, 3 and 4 to account for this.

I do agree with you about the disadvantages of linking forms in your scenario of Forms 2, 3 and 4 can be opened by multiple forms and they need to disable controls in there parent. But regardless of the methods mentioned here, they all require Forms 2, 3, and 4 to be updated when any new Parent Forms/Controls are created

The way I see it is that if Form 2 needs to disable any controls in Form 1 then the 2 forms are already quite related (even if not directly by code). Therefore I see the best logic in being that anything in Form2 that determines that state of controls in Form1 should be presented as a property/method. Then Form1 can query the values at any time and update its own control state (perhaps an update event or if it is a Dialog then on close/result)

So...

Form2 has a property InvalidData
Form2 has an event Update
Form1 listens for Update event and then if InvalidData then disable control

...but then when Form3 pops up, you have to update code in Form1 to check state of new Forms properties. I just cannot think why a child form would need to disable controls in a parent unless that form was specifically created for that parent form alone

Oops, now I'm rambling. Happy holidays
return 5;

AnswerRe: desable a menustrip item Pin
AussieLew21-Dec-10 13:08
AussieLew21-Dec-10 13:08 
QuestionSTUN/NAT Traversal -> Connecting Problem Pin
softwarejaeger21-Dec-10 2:08
softwarejaeger21-Dec-10 2:08 
AnswerRe: STUN/NAT Traversal -> Connecting Problem Pin
Pete O'Hanlon21-Dec-10 3:05
mvePete O'Hanlon21-Dec-10 3:05 
Questionshowing more than one row in a single cell in datagridview Pin
Erdinc2720-Dec-10 23:35
Erdinc2720-Dec-10 23:35 
AnswerRe: showing more than one row in a single cell in datagridview Pin
Eddy Vluggen21-Dec-10 7:56
professionalEddy Vluggen21-Dec-10 7:56 
GeneralRe: showing more than one row in a single cell in datagridview Pin
Erdinc2721-Dec-10 22:16
Erdinc2721-Dec-10 22:16 
GeneralRe: showing more than one row in a single cell in datagridview Pin
Eddy Vluggen22-Dec-10 0:38
professionalEddy Vluggen22-Dec-10 0:38 
GeneralRe: showing more than one row in a single cell in datagridview [modified] Pin
Erdinc2722-Dec-10 21:35
Erdinc2722-Dec-10 21:35 
GeneralRe: showing more than one row in a single cell in datagridview Pin
Eddy Vluggen23-Dec-10 22:37
professionalEddy Vluggen23-Dec-10 22:37 
QuestionToolStripControlHost Info? [modified] Pin
Rafone20-Dec-10 13:40
Rafone20-Dec-10 13:40 
AnswerRe: ToolStripControlHost Info? Pin
Abhinav S20-Dec-10 17:19
Abhinav S20-Dec-10 17:19 
AnswerRe: ToolStripControlHost Info? Pin
RaviRanjanKr20-Dec-10 18:41
professionalRaviRanjanKr20-Dec-10 18:41 
Newstell me Pin
mohammed alshaweesh20-Dec-10 12:17
mohammed alshaweesh20-Dec-10 12:17 
GeneralRe: tell me [REPOST] Pin
Henry Minute20-Dec-10 13:35
Henry Minute20-Dec-10 13:35 
GeneralRe: tell me Pin
Dave Kreskowiak20-Dec-10 15:59
mveDave Kreskowiak20-Dec-10 15:59 
GeneralRe: tell me Pin
RobCroll21-Dec-10 4:29
RobCroll21-Dec-10 4:29 
Questionprint selected row in datagridview using Arraylist as a datasource Pin
Honeyboy_2020-Dec-10 6:25
Honeyboy_2020-Dec-10 6:25 

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.