Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

1

16.04.2005, 16:54

Mit Checkboxes arbeiten??

Hi,

wie kann ich einzelne Einträge der Checkbox löschen und erstellen? Ich arbeite mit Windows Forms.
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

David Scherfgen

Administrator

Beiträge: 10 382

Wohnort: Hildesheim

Beruf: Wissenschaftlicher Mitarbeiter

  • Private Nachricht senden

2

16.04.2005, 17:24

Re: Mit Checkboxes arbeiten??

Zitat von »"bassdscho"«

wie kann ich einzelne Einträge der Checkbox löschen und erstellen? Ich arbeite mit Windows Forms.

Was meinst Du mit "einzelnen Einträgen"?
Eine Check-Box ist doch einfach nur ein Kästchen, wo man ein Häkchen reinsetzen kann.

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

3

16.04.2005, 17:35

Sorry, die genaue Bezeichnung ist:

CheckedListBox
Das sind mehrere Einträge wo man vorne Häckchen machen kann oder auch nicht.
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

4

16.04.2005, 19:05

Wenn de mit WinAPI es machst:

Zitat


LB_INSERTSTRING Message

--------------------------------------------------------------------------------

An application sends an LB_INSERTSTRING message to insert a string into a list box. Unlike the LB_ADDSTRING message, the LB_INSERTSTRING message does not cause a list with the LBS_SORT style to be sorted.

Syntax


To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) LB_INSERTSTRING, // message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam // = (LPARAM) () lParam; );
Parameters

wParam
Specifies the zero-based index of the position at which to insert the string. If this parameter is –1, the string is added to the end of the list.
Microsoft Windows 95/Windows 98/Windows Millennium Edition (Windows Me) : The wParam parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a list box is limited only by available memory.

lParam
Pointer to the null-terminated string to be inserted. If you create the list box with an owner-drawn style but without the LBS_HASSTRINGS style, the value of the lParam parameter is stored as item data instead of the string it would otherwise point to. You can send the LB_GETITEMDATA and LB_SETITEMDATA messages to retrieve or modify the item data.
Return Value

The return value is the index of the position at which the string was inserted. If an error occurs, the return value is LB_ERR. If there is insufficient space to store the new string, the return value is LB_ERRSPACE.



Remarks

The LB_INITSTORAGE message helps speed up the initialization of list boxes that have a large number of items (more than 100). It reserves the specified amount of memory so that subsequent LB_INSERTSTRING messages take the shortest possible time. You can use estimates for the wParam and lParam parameters. If you overestimate, the extra memory is allocated; if you underestimate, the normal allocation is used for items that exceed the requested amount.

If the list box has WS_HSCROLL style and you insert a string wider than the list box, send an LB_SETHORIZONTALEXTENT message to ensure the horizontal scrollbar appears.

Microsoft Windows NT/Windows 2000/Windows XP : For an ANSI application, the system converts the text in a list box to Unicode using CP_ACP. This can cause problems. For example, accented Roman characters in a non-Unicode list box in Japanese Windows will come out garbled. To fix this, either compile the application as Unicode or use an owner-drawn list box.

Message Information

Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

List Boxes, LB_ADDSTRING, LB_SELECTSTRING, LB_SETHORIZONTALEXTENT


UNd wenn du mit MFC arbeitest, einfach:

C-/C++-Quelltext

1
2
3
myListCtrl.InsertItem(
1 // Welche Columne

,"ItemText"); //Dein Text.

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

5

18.04.2005, 22:26

Ich arbeite wohl mit keinem von beidem. weil mit Messages muss ich da eigentlic nichts machen und deine MFC Lösung geht bei mir lieder auch nicht weil ich die Funktion nicht habe.

Die Lösung ist:
CheckedListBox->Items->New(System::String, bool checked);
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

PD

unregistriert

6

18.04.2005, 22:54

Sieht aus nach... öhm... VCL war dat glaub ich? Das was der Borland Builder benutzt ^^

7

18.04.2005, 23:03

ja das sieht eindeutig nach vcl aus.
das hättest du irgendwie dazu schreiben sollen.
is hier glaub ich nicht die verbreitetste library & c++-builder
nicht der verbreitetste compiler/IDE

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

8

05.05.2005, 14:03

eigentlich progg ich des in Visual Studio .NET 2003
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

PD

unregistriert

9

05.05.2005, 14:33

Dann unterstützt der wohl auch VCL ^^

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

10

05.05.2005, 18:27

ich kenn mich doch mit dem zeug nicht so richtig aus. was ist vcl? Des sah halt einfach su, weil man ja nur die Symbole auf sein Form ding schieben muss! ;)
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

Werbeanzeige