MyBase abrunden

  • VB.NET

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von Krschy.

    MyBase abrunden

    ich habe folgenden code fürs abrunden:

    VB.NET-Quellcode

    1. Sub abrunden(ByVal was As Object, _
    2. ByVal x As Integer, ByVal y As Integer, _
    3. ByVal width As Integer, ByVal height As Integer, _
    4. ByVal radius As Integer)
    5. Dim gp As System.Drawing.Drawing2D.GraphicsPath = _
    6. New System.Drawing.Drawing2D.GraphicsPath()
    7. gp.AddLine(x + radius, y, x + width - radius, y)
    8. gp.AddArc(x + width - radius, y, radius, radius, 270, 90)
    9. gp.AddLine(x + width, y + radius, x + width, y + height - radius)
    10. gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90)
    11. gp.AddLine(x + width - radius, y + height, x + radius, y + height)
    12. gp.AddArc(x, y + height - radius, radius, radius, 90, 90)
    13. gp.AddLine(x, y + height - radius, x, y + radius)
    14. gp.AddArc(x, y, radius, radius, 180, 90)
    15. gp.CloseFigure()
    16. was.region = New System.Drawing.Region(gp)
    17. gp.Dispose()
    18. End Sub


    und ich will ein control erstellen das die mybase abrundet..
    ich habs schon so probiert:

    VB.NET-Quellcode

    1. abrunden(Me, 0, 0, Me.Width, Me.Height, 40)
    2. abrunden(MyBase, 0, 0, MyBase.Width, MyBase.Height, 40)
    3. abrunden(Panel1, 0, 0, Panel1.Width, Panel1.Height, 40)


    Folgender Fehler:

    VB.NET-Quellcode

    1. Fehler 1 Auf "MyBase" müssen "." und ein Bezeichner folgen.


    wen ich es undeutlich beschrieben habe, schreibe ich es gerne um ;)


    mfg scream ;)
    ...ich will ein control...
    Also:

    ich will eine form erstellen die in einer dll (usercontrol) gelagert ist...
    also rund ich mybase ab damit die ecken auch abgerundet sind (mybase) , wie bei
    meinem control (me)

    //Edit

    habs nun so probiert...
    und kommt dieser fehler, wen ich mit imports + inherits meine form vererben will:

    Code + Bild


    VB.NET-Quellcode

    1. bei Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance)
    2. bei Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
    3. bei Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments)
    4. bei Style_Form.Form1.abrunden(Object was, Int32 x, Int32 y, Int32 width, Int32 height, Int32 radius) in G:\Robin\Visual Basic Projects\Style-Form\Style-Form\Form1.vb:Zeile 21.
    5. bei Style_Form.Form1.Form1_Load(Object sender, EventArgs e) in G:\Robin\Visual Basic Projects\Style-Form\Style-Form\Form1.vb:Zeile 26.
    6. bei System.Windows.Forms.Form.OnLoad(EventArgs e)
    7. bei System.Windows.Forms.Form.OnCreateControl()
    8. bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    9. bei System.Windows.Forms.Control.CreateControl()
    10. bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    11. bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
    12. bei System.Windows.Forms.Control.set_Visible(Boolean value)
    13. bei System.Windows.Forms.Design.DesignerFrame.Initialize(Control view)
    14. bei System.Windows.Forms.Design.DocumentDesigner.Initialize(IComponent component)
    15. bei System.Windows.Forms.Design.FormDocumentDesigner.Initialize(IComponent component)
    16. bei System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
    17. bei System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
    18. bei System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    19. bei System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    20. bei System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    21. bei System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
    22. bei System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    23. bei Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    24. bei System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)


    Bild:




    wo ist hier der fehler?

    mfg scream ;)

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „Scream“ ()