Click here to Skip to main content
15,916,949 members
Home / Discussions / C#
   

C#

 
AnswerRe: Notepad application code for REDO and FIND Pin
Dave Kreskowiak8-Nov-08 5:39
mveDave Kreskowiak8-Nov-08 5:39 
AnswerRe: Notepad application code for REDO and FIND Pin
Muammar©9-Nov-08 0:25
Muammar©9-Nov-08 0:25 
QuestionHow to convert String to Guid ? Pin
AprNgp7-Nov-08 18:43
AprNgp7-Nov-08 18:43 
AnswerRe: How to convert String to Guid ? Pin
Guffa7-Nov-08 21:38
Guffa7-Nov-08 21:38 
GeneralRe: How to convert String to Guid ? Pin
PIEBALDconsult8-Nov-08 9:22
mvePIEBALDconsult8-Nov-08 9:22 
Questionhow can we find the Installed Path while deploying application Pin
vishnukamath7-Nov-08 18:24
vishnukamath7-Nov-08 18:24 
AnswerRe: how can we find the Installed Path while deploying application Pin
Dave Kreskowiak8-Nov-08 5:00
mveDave Kreskowiak8-Nov-08 5:00 
AnswerRe: how can we find the Installed Path while deploying application Pin
sph3rex8-Nov-08 5:51
sph3rex8-Nov-08 5:51 
Questioncreating discrete histogram : c# & excel programming Pin
raesa7-Nov-08 17:55
raesa7-Nov-08 17:55 
AnswerRe: creating discrete histogram : c# & excel programming Pin
Dave Kreskowiak8-Nov-08 4:38
mveDave Kreskowiak8-Nov-08 4:38 
QuestionPermission assign based on User previllage. Pin
sayemahmed7-Nov-08 16:54
sayemahmed7-Nov-08 16:54 
AnswerRe: Permission assign based on User previllage. Pin
sayemahmed7-Nov-08 17:07
sayemahmed7-Nov-08 17:07 
AnswerRe: Permission assign based on User previllage. Pin
Dave Kreskowiak8-Nov-08 4:35
mveDave Kreskowiak8-Nov-08 4:35 
QuestionXML as database Pin
nelsonpaixao7-Nov-08 15:32
nelsonpaixao7-Nov-08 15:32 
AnswerRe: XML as database Pin
#realJSOP8-Nov-08 0:06
professional#realJSOP8-Nov-08 0:06 
QuestionSave TO xml FROM datagridview Pin
nelsonpaixao7-Nov-08 15:16
nelsonpaixao7-Nov-08 15:16 
AnswerRe: Save TO xml FROM datagridview Pin
Dave Kreskowiak8-Nov-08 4:31
mveDave Kreskowiak8-Nov-08 4:31 
AnswerRe: Save TO xml FROM datagridview Pin
Mbah Dhaim8-Nov-08 4:59
Mbah Dhaim8-Nov-08 4:59 
QuestionCan anybody give link to good article on instumentation (Tracing) in application? I tried to search though. Pin
Member 23244837-Nov-08 13:28
Member 23244837-Nov-08 13:28 
QuestionEmbedded Xml: Ok it work, but ... why? Pin
nelsonpaixao7-Nov-08 13:20
nelsonpaixao7-Nov-08 13:20 
AnswerRe: Embedded Xml: Ok it work, but ... why? Pin
Guffa7-Nov-08 14:31
Guffa7-Nov-08 14:31 
AnswerRe: Embedded Xml: Ok it work, but ... why? Pin
Anthony Mushrow7-Nov-08 14:53
professionalAnthony Mushrow7-Nov-08 14:53 
AnswerRe: Embedded Xml: Ok it work, but ... why? Pin
nelsonpaixao7-Nov-08 15:06
nelsonpaixao7-Nov-08 15:06 
QuestionHelp with Properties.Settings.Default.Save() Pin
Project2477-Nov-08 13:12
Project2477-Nov-08 13:12 
Hey, i have this form that makes a grid of buttons, and when you click on the button it changes color.

The point of this is so i can do a check later and if the button is green i will turn on something.

Problem is it doesn't seem to save my settings, infact it doesn't seem to read the settings.default values after drawing

The settings look like:
Name | Type | Scope | Value
Mon0 Bool User True
Mon1 Bool User True
Mon2 Bool User False //and so forth for the next 165 options


        void CreateButton() 
	{ 
	 
	    List<list><button>> btns=new List<list><button>>(); 
	 
	        string[] day = new string[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; 
	        int hour = 24;
                string name;
	 
	        for (int i = 0; i < day.Length; i++) 
	        { 
	            List<button> buttons = new List<button>(); 
	            for (int j = 0; j < hour; j++) 
	            { 	                
	                Button btn = new Button(); 
	                btn.Name = GenerateButtonName(day[i],j);
                    name = btn.Name.Substring(3);              
                foreach (SettingsProperty currentProperty in Properties.Settings.Default.Properties)
                    {
                        if (currentProperty.Name == name)
                        {
                            if (currentProperty.DefaultValue.Equals("True"))
                            {
                                btn.BackColor = System.Drawing.Color.Green;
                            }
                            else
                            { 
                                btn.BackColor = System.Drawing.Color.LightGray;
                            }
                        }
                    }                                               
                    btn.Location = new System.Drawing.Point(445, 130);
                    btn.Size = new System.Drawing.Size(14, 14);
                    btn.Click += new System.EventHandler(btn_Click);
	            buttons.Add(btn);
                    tableLayoutPanel1.Controls.Add(btn, j, i); 
	            } 
	            btns.Add(buttons);    
	        }  
	} 


        private void btn_Click(object sender, EventArgs e)
        {
            string senderName;
            senderName = ((System.Windows.Forms.Button)sender).Name.Substring(3); 
   
            if (((System.Windows.Forms.Button)sender).BackColor == System.Drawing.Color.Green)
            {
                ((System.Windows.Forms.Button)sender).BackColor = System.Drawing.Color.LightGray;    
                foreach (SettingsProperty currentProperty in Properties.Settings.Default.Properties)
                {
                    if (currentProperty.Name == senderName)
                    {                              
                            currentProperty.DefaultValue = "False";
                        //TODO: Add a exit call
                    }
                }        
            }
            else
            {
                ((System.Windows.Forms.Button)sender).BackColor = System.Drawing.Color.Green;
                foreach (SettingsProperty currentProperty in Properties.Settings.Default.Properties)
                {
                    if (currentProperty.Name == senderName)
                    {
                        currentProperty.DefaultValue = "True";                        
                    }
                } 
            }          
        }
</button></button></button></list></button></list>

I have a button on the form that calls the Properties.Settings.Default.Save().
It does draw the buttons, according to the settings, the first 3 are green, the rest are grey, but when i put in a statement that made a label equal the value of Mon0, even though the values are drawing as True and the tabel in the settings says true, its returning the value False.

Can anyone help! I'v been ripping my hair out over this for days! Let me know if you need more info or want a copy of the project.
QuestionMultiline string property at design time (like RTF) Pin
Chris Copeland7-Nov-08 11:13
mveChris Copeland7-Nov-08 11: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.