Was ist das Objekt von der Klasse Rechteck (Informatik)?

3 Antworten

Naja, ein Objekt zur Darstellung eine Rechtecks im grafischen Sinne würde eben die Daten eines Rechtecks enthalten. Das Objekt wäre ein konkretes Rechteck, z.B. ein grünes mit Kantenlänge 4,5cm.

Ich würde einfach "ein konkretes Rechteck, z.B. der Rahmen dieser Zelle" schreiben.

Sieht soweit richtig aus, auch wenn du hier natürlich auch mehrere Attribute und -Werte anführen könntest.

Als Rechteck kannst du beispielsweise "Button" wählen.

J0T4T4  11.09.2022, 17:04

Ein Button ist mehr als nur ein Rechteck.

0
J0T4T4  11.09.2022, 17:18
@interrogatio1

Nein, ein Button wird immer mehr als nur ein Rechteck sein. Ein Rechteck ist höchstens ein Attributwert des Attributes "Form" eines Buttons.

0
Erzesel  11.09.2022, 17:42
@interrogatio1

nein... ein Rechteck ist einfach ein Objekt mit den Propertys: X,Y,Width.Height .

zB.:

myRect1.X = 10;
myRect1.Y = 100;
myRect1.Width = 150;
myRect1.Height = 100;

Ein Button-Objekt hat unter System.Windows.Forms.Button folgende Propertys (ohne Subpropertys)

zB.

AutoSizeMode                       : GrowOnly
DialogResult                       : None
AutoEllipsis                       : False
AutoSize                           : False
BackColor                          : Color [Control]
FlatStyle                          : Standard
FlatAppearance                     : System.Windows.Forms.FlatButtonAppearance
Image                              :
ImageAlign                         : MiddleCenter
ImageIndex                         : -1
ImageKey                           :
ImageList                          :
ImeMode                            : Disable
Text                               :
TextAlign                          : MiddleCenter
TextImageRelation                  : Overlay
UseMnemonic                        : True
UseCompatibleTextRendering         : True
UseVisualStyleBackColor            : True
AccessibilityObject                : ControlAccessibleObject: Owner = System.Windows.Forms.Button, Text:
AccessibleDefaultActionDescription :
AccessibleDescription              :
AccessibleName                     :
AccessibleRole                     : Default
AllowDrop                          : False
Anchor                             : Top, Left
AutoScrollOffset                   : {X=0,Y=0}
LayoutEngine                       : System.Windows.Forms.Layout.DefaultLayout
BackgroundImage                    :
BackgroundImageLayout              : Tile
BindingContext                     :
Bottom                             : 23
Bounds                             : {X=0,Y=0,Width=75,Height=23}
CanFocus                           : False
CanSelect                          : True
Capture                            : False
CausesValidation                   : True
ClientRectangle                    : {X=0,Y=0,Width=75,Height=23}
ClientSize                         : {Width=75, Height=23}
CompanyName                        : Microsoft Corporation
ContainsFocus                      : False
ContextMenu                        :
ContextMenuStrip                   :
Controls                           : {}
Created                            : True
Cursor                             : [Cursor: Default]
DataBindings                       : {}
DeviceDpi                          : 96
DisplayRectangle                   : {X=0,Y=0,Width=75,Height=23}
IsDisposed                         : False
Disposing                          : False
Dock                               : None
Enabled                            : True
Focused                            : False
Font                               : [Font: Name=Microsoft Sans Serif, Size=8,25, Units=3, GdiCharSet=0, GdiVerticalFont=False]
ForeColor                          : Color [ControlText]
Handle                             : 27461364
HasChildren                        : False
Height                             : 23
IsHandleCreated                    : True
InvokeRequired                     : False
IsAccessible                       : False
IsMirrored                         : False
Left                               : 0
Location                           : {X=0,Y=0}
Margin                             : {Left=3,Top=3,Right=3,Bottom=3}
MaximumSize                        : {Width=0, Height=0}
MinimumSize                        : {Width=0, Height=0}
Name                               :
Parent                             :
ProductName                        : Microsoft® .NET Framework
ProductVersion                     : 4.8.4550.0
RecreatingHandle                   : False
Region                             :
Right                              : 75
RightToLeft                        : No
Site                               :
Size                               : {Width=75, Height=23}
TabIndex                           : 0
TabStop                            : True
Tag                                :
Top                                : 0
TopLevelControl                    :
UseWaitCursor                      : False
Visible                            : True
Width                              : 75
WindowTarget                       : System.Windows.Forms.Control+ControlNativeWindow
PreferredSize                      : {Width=75, Height=23}
Padding                            : {Left=0,Top=0,Right=0,Bottom=0}

0

Objekt von Rechteck könnte Viereck sein, oder "geometrische Figur".

Woher ich das weiß:Berufserfahrung
J0T4T4  11.09.2022, 17:25

Nein, das wären Basisklassen.

0