Click here to Skip to main content
15,926,290 members
Home / Discussions / C#
   

C#

 
QuestionHow to remove a registry key during un-install (with the VS Setup Project) Pin
Kaare Tragethon17-Jun-10 8:49
Kaare Tragethon17-Jun-10 8:49 
AnswerRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Not Active17-Jun-10 9:47
mentorNot Active17-Jun-10 9:47 
GeneralRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Kaare Tragethon17-Jun-10 10:59
Kaare Tragethon17-Jun-10 10:59 
GeneralRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Not Active17-Jun-10 11:17
mentorNot Active17-Jun-10 11:17 
GeneralRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Kaare Tragethon17-Jun-10 23:16
Kaare Tragethon17-Jun-10 23:16 
GeneralRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Not Active18-Jun-10 0:48
mentorNot Active18-Jun-10 0:48 
GeneralRe: How to remove a registry key during un-install (with the VS Setup Project) Pin
Kaare Tragethon18-Jun-10 1:45
Kaare Tragethon18-Jun-10 1:45 
QuestionSAPI speech problem! Pin
Warren2kx17-Jun-10 8:19
Warren2kx17-Jun-10 8:19 
AnswerRe: SAPI speech problem! Pin
Ravi Bhavnani17-Jun-10 8:49
professionalRavi Bhavnani17-Jun-10 8:49 
GeneralRe: SAPI speech problem! Pin
Warren2kx21-Jun-10 11:08
Warren2kx21-Jun-10 11:08 
GeneralRe: SAPI speech problem! Pin
Ravi Bhavnani21-Jun-10 11:13
professionalRavi Bhavnani21-Jun-10 11:13 
QuestionWhy cannot delegate set the form control? Pin
yu-jian17-Jun-10 7:55
yu-jian17-Jun-10 7:55 
AnswerRe: Why cannot delegate set the form control? Pin
Abhinav S17-Jun-10 8:08
Abhinav S17-Jun-10 8:08 
AnswerRe: Why cannot delegate set the form control? Pin
Luc Pattyn17-Jun-10 8:17
sitebuilderLuc Pattyn17-Jun-10 8:17 
AnswerRe: Why cannot delegate set the form control? Pin
Adam R Harris17-Jun-10 9:07
Adam R Harris17-Jun-10 9:07 
Luc is right.

Try something like this

using System;
using System.Windows.Forms;
namespace DelegateForm 
{
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        
        private void TestDelegate() {
            System.Threading.Thread.Sleep(1000);
            OnAdd2List myDelegate;
            myDelegate = new OnAdd2List(Add2List);
            myDelegate(DateTime.Now.ToString());
        }

        private void Add2List(string s) {
            AddItem(s);
        }

        private delegate void OnAdd2List(string s);
        private void button1_Click(object sender, EventArgs e) {
            this._thread = new System.Threading.Thread(new System.Threading.ThreadStart(TestDelegate));
            this._thread.Start();
        }

        private void button2_Click(object sender, EventArgs e) {
        }


	// a delegate to get called on the main thread if need be
	private delegate void delAddItem(string item);

        private void AddItem(string item){
	    // Check if the listview requires an invoke
	    if (listView1.InvokeRequired){
		// Create the delegate
		delAddItem del = new delAddItem(AddItem);
		// Invoke it in the main thread
		this.invoke(del, item);
	    }
	    else{
		// just add the new item
		listView1.Items.Add(item);
	    }
  	}

        private System.Threading.Thread _thread;
    }
}

If at first you don't succeed ... post it on The Code Project and Pray.

QuestionPInvoke for DirectoryInfo Class Pin
CodingDaddy17-Jun-10 7:12
CodingDaddy17-Jun-10 7:12 
AnswerRe: PInvoke for DirectoryInfo Class Pin
CodingDaddy18-Jun-10 4:03
CodingDaddy18-Jun-10 4:03 
QuestionHow to add License Functionality in Dot Net Assembly. Pin
codeproject_Tarun17-Jun-10 5:44
codeproject_Tarun17-Jun-10 5:44 
AnswerRe: How to add License Functionality in Dot Net Assembly. Pin
Ennis Ray Lynch, Jr.17-Jun-10 5:49
Ennis Ray Lynch, Jr.17-Jun-10 5:49 
GeneralRe: How to add License Functionality in Dot Net Assembly. Pin
codeproject_Tarun17-Jun-10 23:51
codeproject_Tarun17-Jun-10 23:51 
QuestionGroupBox Set To Back Pin
Endien17-Jun-10 5:36
Endien17-Jun-10 5:36 
AnswerRe: GroupBox DockStyle Pin
dan!sh 17-Jun-10 5:40
professional dan!sh 17-Jun-10 5:40 
GeneralRe: GroupBox DockStyle Pin
Endien17-Jun-10 5:55
Endien17-Jun-10 5:55 
AnswerRe: GroupBox Set To Back Pin
Luc Pattyn17-Jun-10 6:32
sitebuilderLuc Pattyn17-Jun-10 6:32 
GeneralRe: GroupBox Set To Back Pin
Endien17-Jun-10 6:58
Endien17-Jun-10 6:58 

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.