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
Eddy Vluggen18-Apr-19 1:21
professionalEddy Vluggen18-Apr-19 1:21 
AnswerRe: sample application to customize combo box with multi selection an check box in winform Pin
OriginalGriff18-Apr-19 3:43
mveOriginalGriff18-Apr-19 3:43 
GeneralRe: sample application to customize combo box with multi selection an check box in winform Pin
#realJSOP18-Apr-19 8:00
mve#realJSOP18-Apr-19 8:00 
GeneralRe: sample application to customize combo box with multi selection an check box in winform Pin
OriginalGriff18-Apr-19 8:05
mveOriginalGriff18-Apr-19 8:05 
GeneralRe: sample application to customize combo box with multi selection an check box in winform Pin
Dave Kreskowiak18-Apr-19 8:55
mveDave Kreskowiak18-Apr-19 8:55 
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 
Hi, I am beginner in C# and I didn't found solved my problem.
In app I add tabPage with new text box and some others parameters (labels, etc.) and I wanna save all items to C# config file. The tabs is adds if app is running. Is it possible to save all TabPages in TabControl to C# config file ?

Code:
void AddTab()
        {
            bool existTabPage = false;
            UInt16 allChceked = 0;

            foreach (TabPage t in tabControl1.TabPages)
            {
                TabPage tabPage1 = new TabPage(tb_PlcUrl.Text);
                if (tabControl1.TabPages.ContainsKey(tb_PlcUrl.Text))
                {
                    existTabPage = true;
                }
                allChceked++;
            }

            if (!existTabPage && allChceked == tabControl1.TabCount)
            {
                TabPage tabPage1 = new TabPage();
                tabPage1.Name = tb_PlcUrl.Text;
                tabPage1.Text = tb_PlcUrl.Text;

                TextBox tb = new TextBox();

                tb.Location = new System.Drawing.Point(65, 19);
                tb.Size = new System.Drawing.Size(133, 20);
                tb.Text = tb_PlcUrl.Text;
                tb.BorderStyle = BorderStyle.None;
                tb.ReadOnly = true;
                tabPage1.Controls.Add(tb);

                Label labIpPlc = new Label();
                labIpPlc.Location = new System.Drawing.Point(18, 19);
                labIpPlc.Size = new System.Drawing.Size(133, 20);
                labIpPlc.Text = "PLC1";
                tabPage1.Controls.Add(labIpPlc);


                tabControl1.TabPages.Add(tabPage1);
            }
            else MessageBox.Show("Already exist : *" + tb_PlcUrl.Text);

        }


And if I close, the app make something like that:

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{

    foreach (TabPage item in tabControl1.TabPages)
    {
        //Save everything from tabs
        Properties.Settings.Default.TabPages[i] = tabControl1.TabPages[i];
        i++;
    }
    Properties.Settings.Default.Save();
    Application.Exit();
}


Thank you for help !
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 
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 

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.