Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. i want to create my own button in vb.net

i want to create my own button in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anujose
    wrote on last edited by
    #1

    instead of inheritting button class i want to create a button in component class. in that class where i can call pen and brush to make button ?

    H G 2 Replies Last reply
    0
    • A anujose

      instead of inheritting button class i want to create a button in component class. in that class where i can call pen and brush to make button ?

      H Offline
      H Offline
      haneef1
      wrote on last edited by
      #2

      dim mybutton as new Button mybotton.Text="button" sk.haneef@gmail.com

      this is haneef

      G 1 Reply Last reply
      0
      • A anujose

        instead of inheritting button class i want to create a button in component class. in that class where i can call pen and brush to make button ?

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        Use the Paint event. The EventArgs contains a Graphics object that you can use for the drawing.

        --- Year happy = new Year(2007);

        A 1 Reply Last reply
        0
        • H haneef1

          dim mybutton as new Button mybotton.Text="button" sk.haneef@gmail.com

          this is haneef

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          I don't think that you understood the question at all...

          --- Year happy = new Year(2007);

          1 Reply Last reply
          0
          • G Guffa

            Use the Paint event. The EventArgs contains a Graphics object that you can use for the drawing.

            --- Year happy = new Year(2007);

            A Offline
            A Offline
            anujose
            wrote on last edited by
            #5

            Thanks for the reply.but where i will call the paint method in my component class

            A G 2 Replies Last reply
            0
            • A anujose

              Thanks for the reply.but where i will call the paint method in my component class

              A Offline
              A Offline
              anujose
              wrote on last edited by
              #6

              Imports System.Windows.Forms Imports System.Drawing Public Class FlatButton Public Sub Onpaint() Dim obj As Graphics obj.DrawRectangle(New Pen(Color.DarkOliveGreen), New Rectangle(0, 0, 100, 100)) obj.FillRectangle(New SolidBrush(Color.DarkRed), New Rectangle(0, 0, 100, 100)) End Sub This is my class .now i don't want to enter events and properties.just i want to create one outline of my button.please give me a reply. i want to make dll file of this component in one project and i want to add this button to my form.please anyone give a reply

              1 Reply Last reply
              0
              • A anujose

                Thanks for the reply.but where i will call the paint method in my component class

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #7

                anujose wrote:

                but where i will call the paint method in my component class

                You don't. The event will be called whenever the control needs to be drawn. That is the way that you provide the code that the system uses to draw your control.

                --- Year happy = new Year(2007);

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups