Click here to Skip to main content
15,906,329 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
OriginalGriff25-Mar-21 5:03
mveOriginalGriff25-Mar-21 5:03 
GeneralRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
Gerry Schmitz25-Mar-21 7:42
mveGerry Schmitz25-Mar-21 7:42 
GeneralRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
OriginalGriff25-Mar-21 11:09
mveOriginalGriff25-Mar-21 11:09 
AnswerRe: How to access cell information and controls of DevExpress Spreadsheet Form from another form in the same application? Pin
Gerry Schmitz25-Mar-21 7:40
mveGerry Schmitz25-Mar-21 7:40 
QuestionChecking for existing open forms Pin
Alex Dunlop24-Mar-21 23:26
Alex Dunlop24-Mar-21 23:26 
AnswerRe: Checking for existing open forms Pin
OriginalGriff24-Mar-21 23:38
mveOriginalGriff24-Mar-21 23:38 
GeneralRe: Checking for existing open forms Pin
Alex Dunlop25-Mar-21 0:08
Alex Dunlop25-Mar-21 0:08 
GeneralRe: Checking for existing open forms Pin
OriginalGriff25-Mar-21 0:37
mveOriginalGriff25-Mar-21 0:37 
Yes - and you are adding a form to the collection.
When you call Show, it adds the new form to the Application.OpenForms collection, and since fc is a reference to that collection, you are modifying the collection which you are iterating over it. Worse, you are adding it every time an existing form is not teh one you are looking for!

You can't do that.

The way I'd do it is simpler:
C#
if (!Application.OpenForms.Cast<Form>().Any(frm => frm.Name == "Chart"))
    {
    ... add your new form ...
    }

"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

AnswerRe: Checking for existing open forms Pin
Richard Deeming25-Mar-21 2:51
mveRichard Deeming25-Mar-21 2:51 
QuestionCopy a selected gridview row to the same gridview Pin
Member 1493285423-Mar-21 2:41
Member 1493285423-Mar-21 2:41 
AnswerRe: Copy a selected gridview row to the same gridview Pin
Gerry Schmitz23-Mar-21 7:08
mveGerry Schmitz23-Mar-21 7:08 
GeneralRe: Copy a selected gridview row to the same gridview Pin
Nathan Minier24-Mar-21 1:20
professionalNathan Minier24-Mar-21 1:20 
GeneralRe: Copy a selected gridview row to the same gridview Pin
jsc4224-Mar-21 1:25
professionaljsc4224-Mar-21 1:25 
GeneralRe: Copy a selected gridview row to the same gridview Pin
Nathan Minier24-Mar-21 1:38
professionalNathan Minier24-Mar-21 1:38 
GeneralRe: Copy a selected gridview row to the same gridview Pin
jsc4225-Mar-21 3:54
professionaljsc4225-Mar-21 3:54 
QuestionHow to able to have the information of the particular image button clicked? Pin
Member 1508474922-Mar-21 10:50
Member 1508474922-Mar-21 10:50 
AnswerRe: How to able to have the information of the particular image button clicked? Pin
OriginalGriff22-Mar-21 11:18
mveOriginalGriff22-Mar-21 11:18 
GeneralRe: How to able to have the information of the particular image button clicked? Pin
Richard Deeming22-Mar-21 22:25
mveRichard Deeming22-Mar-21 22:25 
AnswerRe: How to able to have the information of the particular image button clicked? Pin
Richard Deeming22-Mar-21 22:33
mveRichard Deeming22-Mar-21 22:33 
AnswerRe: How to able to have the information of the particular image button clicked? Pin
DerekT-P23-Mar-21 0:46
professionalDerekT-P23-Mar-21 0:46 
QuestionC# Excel test specific cells in a column Pin
Steve Rudd22-Mar-21 5:59
Steve Rudd22-Mar-21 5:59 
AnswerRe: C# Excel test specific cells in a column Pin
Gerry Schmitz22-Mar-21 7:40
mveGerry Schmitz22-Mar-21 7:40 
GeneralRe: C# Excel test specific cells in a column Pin
Steve Rudd22-Mar-21 9:31
Steve Rudd22-Mar-21 9:31 
GeneralRe: C# Excel test specific cells in a column Pin
Richard MacCutchan22-Mar-21 22:56
mveRichard MacCutchan22-Mar-21 22:56 
GeneralRe: C# Excel test specific cells in a column Pin
Steve Rudd23-Mar-21 0:13
Steve Rudd23-Mar-21 0:13 

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.