Results 1 to 10 of 10

Thread: TCheckListBox help...

  1. #1
    Join Date
    Jul 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TCheckListBox help...

    Ok I have a TCheckListBox but I have no idea how to use it...for example I want SCAR to do one thing if a certain item in that box is checked. How do I go about doing that? Thanks.

  2. #2
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Barrier View Post
    Ok I have a TCheckListBox but I have no idea how to use it...for example I want SCAR to do one thing if a certain item in that box is checked. How do I go about doing that? Thanks.
    Hmm, i personnaly have got a CheckListBox in my form:
    I only use to see if a box is checked, however CheckListBox.Checked[boxnumber] is the command, it took me a while to find out. To check wether there is a change, hmm, try this one.:
    SCAR Code:
    CheckListBox.OnClicK := @Change
    I dont think there is a way to do a action on a special box. I might be wrong
    Verrekte Koekwous

  3. #3
    Join Date
    Jul 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Hmm, i personnaly have got a CheckListBox in my form:
    I only use to see if a box is checked, however CheckListBox.Checked[boxnumber] is the command, it took me a while to find out. To check wether there is a change, hmm, try this one.:
    SCAR Code:
    CheckListBox.OnClicK := @Change
    I dont think there is a way to do a action on a special box. I might be wrong
    Thanks, I only wanted to know about CheckListBox.Checked[]. Now I have a question about TComboBox. How do I control the items in my ComboBox? For example when the user chooses item one which is F1 can I get SCAR to write to the debug box F1? If so how do I do that?

  4. #4
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Barrier View Post
    Thanks, I only wanted to know about CheckListBox.Checked[]. Now I have a question about TComboBox. How do I control the items in my ComboBox? For example when the user chooses item one which is F1 can I get SCAR to write to the debug box F1? If so how do I do that?
    Quite simple: You add this command:
    Code:
     ComboBox.OnChange := @Change;
         And this if you like (i do, it makes sure you cant type in the box ;)) : 
       ComboBox.Style := csDropDownList
    Then you make a procedure like this:
    SCAR Code:
    Procedure Change(Sender : TOBject);
    begin;
      case ComboBox.ItemIndex of
      0 : writeln('Item 0 is used');
      1 : writleN('item 1 is used');
      end;
    end;
    Like this?
    Verrekte Koekwous

  5. #5
    Join Date
    Jul 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Quite simple: You add this command:
    Code:
     ComboBox.OnChange := @Change;
         And this if you like (i do, it makes sure you cant type in the box ;)) : 
       ComboBox.Style := csDropDownList
    Then you make a procedure like this:
    SCAR Code:
    Procedure Change(Sender : TOBject);
    begin;
      case ComboBox.ItemIndex of
      0 : writeln('Item 0 is used');
      1 : writleN('item 1 is used');
      end;
    end;
    Like this?
    That is useful but I was looking for something like this:
    If (First item in combo box (F1) is selected) Then
    Begin
    WriteINI(Blah);
    End;

  6. #6
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Barrier View Post
    That is useful but I was looking for something like this:
    If (First item in combo box (F1) is selected) Then
    Begin
    WriteINI(Blah);
    End;
    Like this:
    SCAR Code:
    If ComboBox.ItemIndex = 0 Then
      Begin
      WriteINI(Blah);
      End;
    Verrekte Koekwous

  7. #7
    Join Date
    Jul 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Like this:
    SCAR Code:
    If ComboBox.ItemIndex = 0 Then
      Begin
      WriteINI(Blah);
      End;
    Thank you I really appreciate this!

  8. #8
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Barrier View Post
    Thank you I really appreciate this!
    Anytime .
    Verrekte Koekwous

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Erm...since the text in the combobox changes when you seleect an item you can just do:

    SCAR Code:
    Combobox1.OnChange := @Change;

    SCAR Code:
    procedure Change(Senders : TObject);
    begin
      case Combobox1.Text of
        'Whatever' : WriteLn('Whatever');
        'Something' : WriteLn('Something');
      end;
    end;
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  10. #10
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SantaClause View Post
    Erm...since the text in the combobox changes when you seleect an item you can just do:

    SCAR Code:
    Combobox1.OnChange := @Change;

    SCAR Code:
    procedure Change(Senders : TObject);
    begin
      case Combobox1.Text of
        'Whatever' : WriteLn('Whatever');
        'Something' : WriteLn('Something');
      end;
    end;
    Meh, numbers is shorter .
    Verrekte Koekwous

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •