Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: sample application to customize combo box with multi selection an check box in winform Pin
Gerry Schmitz18-Apr-19 6:12
mveGerry Schmitz18-Apr-19 6:12 
GeneralRe: sample application to customize combo box with multi selection an check box in winform Pin
OriginalGriff18-Apr-19 6:34
mveOriginalGriff18-Apr-19 6:34 
QuestionHow store all TabPage items in c# Pin
Richi38117-Apr-19 22:58
Richi38117-Apr-19 22:58 
AnswerRe: How store all TabPage items in c# Pin
OriginalGriff17-Apr-19 23:34
mveOriginalGriff17-Apr-19 23:34 
AnswerRe: How store all TabPage items in c# Pin
#realJSOP18-Apr-19 2:18
mve#realJSOP18-Apr-19 2:18 
GeneralRe: How store all TabPage items in c# Pin
Richi38125-Apr-19 20:29
Richi38125-Apr-19 20:29 
AnswerRe: How store all TabPage items in c# Pin
Gerry Schmitz18-Apr-19 6:09
mveGerry Schmitz18-Apr-19 6:09 
AnswerRe: How store all TabPage items in c# Pin
BillWoodruff18-Apr-19 20:48
professionalBillWoodruff18-Apr-19 20:48 
Remember that all of us were beginners once, and I'd guess many of us have, in the initial stages of learning UI development, and such advanced techniques as run-time Control generation, gotten ... confused Smile | :)

And, I think you are quite confused, here. In this loop:
  foreach (TabPage t in tabControl1.TabPages)
{
    TabPage tabPage1 = new TabPage(tb_PlcUrl.Text);
    if (tabControl1.TabPages.ContainsKey(tb_PlcUrl.Text))
    {
        existTabPage = true;
    }
    allChceked++;
}
You created a new TabPage, but you never used it: outside of the loop it is reclaimed by memory management ... effectively, it doesn't exist.

Serialization of WinForm Controls is problematic in terms of basic Types, like Fonts and Colors, and, for some Controls that contain other Controls (ex. DateTimePicker) or elements that are non serializable (ex. TreeView's NodeCollection). It's a shame WinForms did not include a powerful save/restore feature for all built-in Controls from the start.

I think your first goal should be a better understanding of C# and object.Control creation; for that, I suggest getting a really good book and combining study with programming small examples ... in the past the books on WinForms by Jesse Liberty and Chris Sells were most useful to me.

As you approach the task of saving and restoring run-time created Controls, like TabPages, I suggest you carefully consider:

1. basic attributes: text, color, location

1.a. basic state: visible, enabled, focused, selected, etc.

2. the issue of restoring event handlers ... which cannot be saved ... you've attached at run-time.

3. the extent to which the run-time user is constrained in terms of what they can create, how many whatevers they can create, etc.

4. ... of course: the data ... the unique content of each Control in the TabPage

I suggest you edit your post here, and describe the contents of one of your run-time created TabPage: when you want to save the content: what must be saved ?
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot

GeneralRe: How store all TabPage items in c# Pin
Richi38125-Apr-19 21:39
Richi38125-Apr-19 21:39 
AnswerRe: How store all TabPage items in c# Pin
BillWoodruff26-Apr-19 4:09
professionalBillWoodruff26-Apr-19 4:09 
QuestionHow to handle PCB components layout in designing LED switching power supply? Pin
Pcbindex17-Apr-19 19:57
Pcbindex17-Apr-19 19:57 
AnswerRe: How to handle PCB components layout in designing LED switching power supply? Pin
OriginalGriff17-Apr-19 20:05
mveOriginalGriff17-Apr-19 20:05 
Questionlast 3 numbers Pin
_Q12_17-Apr-19 12:04
_Q12_17-Apr-19 12:04 
AnswerRe: last 3 numbers Pin
Gerry Schmitz17-Apr-19 13:05
mveGerry Schmitz17-Apr-19 13:05 
GeneralRe: last 3 numbers Pin
_Q12_17-Apr-19 13:36
_Q12_17-Apr-19 13:36 
AnswerRe: last 3 numbers Pin
Luc Pattyn17-Apr-19 13:11
sitebuilderLuc Pattyn17-Apr-19 13:11 
AnswerRe: last 3 numbers Pin
#realJSOP18-Apr-19 2:04
mve#realJSOP18-Apr-19 2:04 
AnswerRe: last 3 numbers Pin
BillWoodruff18-Apr-19 20:57
professionalBillWoodruff18-Apr-19 20:57 
QuestionWCF Pin
Member 1406752317-Apr-19 4:12
Member 1406752317-Apr-19 4:12 
AnswerRe: WCF Pin
#realJSOP17-Apr-19 4:25
mve#realJSOP17-Apr-19 4:25 
QuestionReferencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 12:11
Member 1427108416-Apr-19 12:11 
AnswerRe: Referencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 15:38
Member 1427108416-Apr-19 15:38 
SuggestionRe: Referencing Dynamic Control Array Data Pin
Richard Deeming17-Apr-19 1:07
mveRichard Deeming17-Apr-19 1:07 
AnswerRe: Referencing Dynamic Control Array Data Pin
BillWoodruff16-Apr-19 16:29
professionalBillWoodruff16-Apr-19 16:29 
AnswerRe: Referencing Dynamic Control Array Data Pin
OriginalGriff16-Apr-19 21:22
mveOriginalGriff16-Apr-19 21:22 

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.