Click here to Skip to main content
15,897,187 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: authenticate windows form using a cookie ? Pin
Mycroft Holmes28-Apr-09 22:40
professionalMycroft Holmes28-Apr-09 22:40 
AnswerRe: authenticate windows form using a cookie ? Pin
Eddy Vluggen28-Apr-09 22:49
professionalEddy Vluggen28-Apr-09 22:49 
QuestionHow to programatically hide a DatagridComboboxColumn? [modified] Pin
rhemy27-Apr-09 20:15
rhemy27-Apr-09 20:15 
AnswerRe: How to programatically hide a DatagridComboboxColumn? [modified] Pin
Michael Bookatz28-Apr-09 1:05
Michael Bookatz28-Apr-09 1:05 
GeneralRe: How to programatically hide a DatagridComboboxColumn? Pin
Henry Minute28-Apr-09 1:12
Henry Minute28-Apr-09 1:12 
GeneralRe: How to programatically hide a DatagridComboboxColumn? Pin
Michael Bookatz28-Apr-09 1:14
Michael Bookatz28-Apr-09 1:14 
AnswerRe: How to programatically hide a DatagridComboboxColumn? Pin
Ageesh28-Apr-09 20:32
Ageesh28-Apr-09 20:32 
QuestionEvent handler for "linked" controls Pin
dybs26-Apr-09 8:48
dybs26-Apr-09 8:48 
Hello,

For several applications I've written, I use a TrackBar and a TextBox to modify a particular value. I want these controls to be synchronized, so when the TrackBar is scrolled, the value in the TextBox is updated, or when the user types a value in the TextBox, the TrackBar automatically scrolls. Also, I typically want to fire an event when the value of this field is modified. Right now I'm using the ValueChanged event for the TrackBar and the TextChanged event for the TextBox, like so:
// Each of these event should only fire once when the value is modified,
// where it's with the TextBox or the TrackBar.
private void trackBar1_ValueChanged(Object sender, EventArgs e)
{
    textBox1.Text = trackBar1.Value.ToString();
    DoSomething();    
}

private void textBox1_TextChanged(Object sender, EventArgs e)
{    
    int value = trackBar1.Value;
    if(int.TryParse(textBox1.Text, out value))
    {  
        trackBar1.Value = value;
    }
}

private void DoSomething()
{
    // I want this code to execute once when the value is modified.
}


Is this the correct way to handle this situation, or is there a better way?

Thanks,

Dybs
AnswerRe: Event handler for "linked" controls Pin
Luc Pattyn26-Apr-09 9:24
sitebuilderLuc Pattyn26-Apr-09 9:24 
GeneralRe: Event handler for "linked" controls Pin
dybs26-Apr-09 9:35
dybs26-Apr-09 9:35 
Questionread data from RS232 in C# windows Pin
narina24-Apr-09 22:51
narina24-Apr-09 22:51 
AnswerRe: read data from RS232 in C# windows Pin
Luc Pattyn25-Apr-09 0:10
sitebuilderLuc Pattyn25-Apr-09 0:10 
GeneralRe: read data from RS232 in C# windows Pin
narina25-Apr-09 0:46
narina25-Apr-09 0:46 
AnswerRe: read data from RS232 in C# windows Pin
dybs25-Apr-09 6:46
dybs25-Apr-09 6:46 
Questionhow to create a seperate form for searching data? Pin
riddhi8424-Apr-09 20:58
riddhi8424-Apr-09 20:58 
AnswerRe: how to create a seperate form for searching data? Pin
Ahamed Azeem25-Apr-09 21:34
Ahamed Azeem25-Apr-09 21:34 
GeneralRe: how to create a seperate form for searching data? Pin
riddhi8426-Apr-09 19:38
riddhi8426-Apr-09 19:38 
GeneralRe: how to create a seperate form for searching data? Pin
Ahamed Azeem26-Apr-09 20:48
Ahamed Azeem26-Apr-09 20:48 
QuestionWindows service Crashing once a day Pin
bsandesh1124-Apr-09 4:59
bsandesh1124-Apr-09 4:59 
AnswerRe: Windows service Crashing once a day Pin
bsandesh1124-Apr-09 5:29
bsandesh1124-Apr-09 5:29 
AnswerRe: Windows service Crashing once a day Pin
Luc Pattyn24-Apr-09 6:38
sitebuilderLuc Pattyn24-Apr-09 6:38 
QuestionHTML to database Pin
digitaldxb23-Apr-09 22:38
digitaldxb23-Apr-09 22:38 
AnswerRe: HTML to database Pin
digitaldxb23-Apr-09 23:42
digitaldxb23-Apr-09 23:42 
QuestionHow to calculate the size of a MDI parent based on its MDI child form Pin
Deling Ren23-Apr-09 15:59
Deling Ren23-Apr-09 15:59 
QuestionHow to create Form which will be taked into account by other desctop appication like Microsoft Shared View Pin
Koltz22-Apr-09 22:48
Koltz22-Apr-09 22:48 

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.