tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
1
ZUGRIFFE
1474
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Binio Binio ist offline Mitglied Gold
    Registriert seit
    Oct 2004
    Ort
    Werl
    Beiträge
    215
    Hallo Leute,

    ich habe ein kleines Problem. Ich schreibe für ein Blinden ein Programm. Dort mussen die ersten 3 Elemente der Combobox -->ComboBox1.Style:=csOwnerDrawFixed sein damit Virgo(BlindenSoftware) die Combobox als Aufklappliste sieht. Das 4 Element soll aber wiederrum zu ein Eingabefeld werden --> ComboBox1.Style:=csDropDown;
    Mein Problem ist nun das wenn jemand ins 4 Element geht der Focus verschwindet und der Blinde nichts ändern kann im 4 Element der Combobox.

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    
    unit Unit1; 
       
      interface 
       
      uses 
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
        Dialogs, StdCtrls; 
       
      type 
        TForm1 = class(TForm) 
        ComboBox1: TComboBox; 
        procedure FormCreate(Sender: TObject); 
        procedure ComboBox1KeyPress(Sender: TObject; var Key: Char); 
       
        procedure ComboBox1Select(Sender: TObject); 
        private 
        { Private-Deklarationen } 
        public 
        { Public-Deklarationen } 
        end; 
       
      var 
        Form1: TForm1; 
       
      implementation 
       
      {$R *.dfm} 
       
      procedure TForm1.FormCreate(Sender: TObject); 
      begin 
      ComboBox1.Text:='Standartwert'; 
      ComboBox1.items.add('nein'); 
      ComboBox1.items.add('Durch alleinstehendes Semikolon'); 
      ComboBox1.items.add('Durch Originalseitenangabe'); 
      ComboBox1.items.add('...'); 
      ComboBox1.ItemIndex:=0; 
      end; 
       
      procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char); 
      begin 
       
       
      if (Combobox1.ItemIndex=0)OR(Combobox1.ItemIndex=1)OR(Combobox1.ItemIndex=2) then 
      begin 
        if not (Key in[#26]) then 
        begin 
        Key := #0; 
        Windows.Beep(500, 100); 
        Windows.Beep(400, 100); 
        Windows.Beep(300, 100); 
        //Windows.Beep(200, 100); 
        //Windows.Beep(100, 100); 
        end 
      end 
      end; 
       
       
      procedure TForm1.ComboBox1Select(Sender: TObject); 
      begin 
      if (Combobox1.ItemIndex=0)OR(Combobox1.ItemIndex=1)OR(Combobox1.ItemIndex=2) then 
        ComboBox1.Style:=csOwnerDrawFixed 
      else 
      begin 
        ComboBox1.Style:=csDropDown; 
        ComboBox1.Focused; 
        ComboBox1.ItemIndex:=3; 
        ComboBox1.SetFocus; 
        //ComboBox1.Refresh 
        //ComboBox1.ItemIndex:=3; 
      end 
      end; 
       
      end.

    Ich hoffe es kann mir einer bei mein Problem helfen

    mfg
    Robert
     
    Ich denke, also bin ich.

  2. #2
    Avatar von Gawayn
    Gawayn Gawayn ist offline Mitglied Brokat
    Registriert seit
    Dec 2003
    Beiträge
    309
    Wenn es wirklich nur am Focus liegt, kannst du den ja über ActiveControl setzen. (Hilfedateien lesen!)

    -Gawayn
     

Ähnliche Themen

  1. Focus neu setzen nach aktiviertem Element
    Von Funj0y im Forum Javascript & Ajax
    Antworten: 12
    Letzter Beitrag: 31.05.10, 13:38
  2. Das DataGridView-Element ist kein bekanntes Element
    Von Vereth im Forum .NET Windows Forms
    Antworten: 0
    Letzter Beitrag: 25.11.09, 17:52
  3. <div>-Element einen Focus geben
    Von Geflügel im Forum Javascript & Ajax
    Antworten: 4
    Letzter Beitrag: 01.09.07, 11:03
  4. Welches Element hat den Focus?
    Von Rudi100 im Forum VisualStudio & MFC
    Antworten: 3
    Letzter Beitrag: 05.10.05, 18:54
  5. Combobox focus setzen
    Von Dirkk im Forum Visual Basic 6.0
    Antworten: 4
    Letzter Beitrag: 31.01.04, 13:13