Click here to Skip to main content
14,837,944 members
Home / Discussions / C#
   

C#

 
AnswerRe: C#, loop statement Pin
Richard MacCutchan15-Feb-21 4:53
mveRichard MacCutchan15-Feb-21 4:53 
AnswerRe: C#, loop statement Pin
Gerry Schmitz15-Feb-21 6:10
mveGerry Schmitz15-Feb-21 6:10 
QuestionRe: C#, loop statement Pin
Kenneth Haugland15-Feb-21 19:42
professionalKenneth Haugland15-Feb-21 19:42 
AnswerRe: C#, loop statement Pin
Richard MacCutchan15-Feb-21 21:13
mveRichard MacCutchan15-Feb-21 21:13 
QuestionWITSML Server And Client in C# Pin
Member 1332584614-Feb-21 21:59
MemberMember 1332584614-Feb-21 21:59 
AnswerRe: WITSML Server And Client in C# Pin
Richard MacCutchan14-Feb-21 22:18
mveRichard MacCutchan14-Feb-21 22:18 
GeneralRe: WITSML Server And Client in C# Pin
Member 1332584614-Feb-21 22:51
MemberMember 1332584614-Feb-21 22:51 
Question[solved] Two-way binding winforms checkbox to property? Pin
RobertSF14-Feb-21 6:21
professionalRobertSF14-Feb-21 6:21 
I have this code
public partial class TrimOptions : Form
{
    public bool trimFirst { get; set; } = false;
    public bool trimLast { get; set; } = false;
    public bool ifBlank { get; set; } = true;

    public TrimOptions()
    {
        InitializeComponent();
        chkTrimFirst.DataBindings.Add(new Binding("Checked", trimFirst, null, false, DataSourceUpdateMode.OnPropertyChanged));
        chkTrimLast.DataBindings.Add(new Binding("Checked", trimLast, null, false, DataSourceUpdateMode.OnPropertyChanged));
        chkIfBlank.DataBindings.Add(new Binding("Checked", ifBlank, null, false, DataSourceUpdateMode.OnPropertyChanged));
    }
Whatever I set the properties to in code is reflected in the UI when the form is displayed. So far, so good. However, the user clicking the checkboxes does not set the properties, and setting the properties programmatically does not change the UI (nor the Checked property of the control).

I would like programmatic changes to the properties to update the UI, and I would like the user changing the UI to update the properties. How to do that?

modified 14-Feb-21 13:43pm.

AnswerRe: Two-way binding winforms checkbox to property? Pin
Gerry Schmitz14-Feb-21 6:37
mveGerry Schmitz14-Feb-21 6:37 
GeneralRe: Two-way binding winforms checkbox to property? Pin
RobertSF14-Feb-21 7:42
professionalRobertSF14-Feb-21 7:42 
GeneralRe: Two-way binding winforms checkbox to property? Pin
Gerry Schmitz14-Feb-21 8:20
mveGerry Schmitz14-Feb-21 8:20 
QuestionNeed code to download file from FTP with Auto Resume functionality in case of Internet disconnection. Pin
Member 1507143012-Feb-21 6:00
MemberMember 1507143012-Feb-21 6:00 
AnswerRe: Need code to download file from FTP with Auto Resume functionality in case of Internet disconnection. Pin
Gerry Schmitz12-Feb-21 9:19
mveGerry Schmitz12-Feb-21 9:19 
AnswerRe: Need code to download file from FTP with Auto Resume functionality in case of Internet disconnection. Pin
Mycroft Holmes12-Feb-21 10:08
professionalMycroft Holmes12-Feb-21 10:08 
AnswerRe: Need code to download file from FTP with Auto Resume functionality in case of Internet disconnection. Pin
Luc Pattyn13-Feb-21 5:56
sitebuilderLuc Pattyn13-Feb-21 5:56 
QuestionDoes anyone know the C# implementation for this? Pin
kangkongflea12-Feb-21 0:38
Memberkangkongflea12-Feb-21 0:38 
SuggestionRe: Does anyone know the C# implementation for this? Pin
Richard MacCutchan12-Feb-21 1:15
mveRichard MacCutchan12-Feb-21 1:15 
AnswerRe: Does anyone know the C# implementation for this? Pin
OriginalGriff12-Feb-21 2:07
mveOriginalGriff12-Feb-21 2:07 
AnswerRe: Does anyone know the C# implementation for this? Pin
Luc Pattyn12-Feb-21 3:37
sitebuilderLuc Pattyn12-Feb-21 3:37 
AnswerRe: Does anyone know the C# implementation for this? Pin
Gerry Schmitz12-Feb-21 9:21
mveGerry Schmitz12-Feb-21 9:21 
QuestionHow to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 7:10
MemberAlex Dunlop11-Feb-21 7:10 
AnswerRe: How to access GUI from another thread? Pin
Gerry Schmitz11-Feb-21 7:39
mveGerry Schmitz11-Feb-21 7:39 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 7:40
MemberAlex Dunlop11-Feb-21 7:40 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 8:07
MemberAlex Dunlop11-Feb-21 8:07 
GeneralRe: How to access GUI from another thread? Pin
Dave Kreskowiak11-Feb-21 13:17
mveDave Kreskowiak11-Feb-21 13:17 

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.