Click here to Skip to main content
15,886,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: date format Pin
Dave Kreskowiak22-May-07 18:00
mveDave Kreskowiak22-May-07 18:00 
QuestionVB.NET Window Form CheckListBox Drag & Drop Item problem Pin
pixeldoc200022-May-07 14:18
pixeldoc200022-May-07 14:18 
QuestionRe: VB.NET Window Form CheckListBox Drag & Drop Item problem Pin
Sonia Gupta22-May-07 18:41
Sonia Gupta22-May-07 18:41 
QuestionProblem on testing custom control Pin
The ANZAC22-May-07 12:25
The ANZAC22-May-07 12:25 
AnswerRe: Problem on testing custom control Pin
Dave Kreskowiak22-May-07 17:55
mveDave Kreskowiak22-May-07 17:55 
GeneralRe: Problem on testing custom control Pin
The ANZAC22-May-07 21:39
The ANZAC22-May-07 21:39 
GeneralRe: Problem on testing custom control Pin
The ANZAC22-May-07 22:01
The ANZAC22-May-07 22:01 
GeneralRe: Problem on testing custom control Pin
Dave Kreskowiak23-May-07 3:06
mveDave Kreskowiak23-May-07 3:06 
The ANZAC wrote:
It's a menustrip dervied from the menustrip which is a user control...right?


Wrong. MenuStrip derives from ToolStrip, which derives from ScrollableControl, which derives from Control, not UserControl. No, they are NOT the same.

Sorry about the reference. You actually do have it set (Project/Properties/References tab).

Control is used if you want to make a new control from scratch, or add to the functionality of another control that derives from Control.

UserControl is usually used to create composite controls consisting of one of more other controls, that should be treated as a COMBINED unit. An example of a compsite control would be your own custom implementation of a NumericUpDown box (NOT inheriting from the existing NumericUpDown class.) You'd add a TextBox to your UserControl, and a couple of buttons for Up and Down.

What kind of project did you create to start coding this control?? If it was Windows Control Library, you picked the wrong project type. Pick a Class Library type instead, then all you have to do is change the code to read like:
Imports System.Windows.Forms
 
Public Class MyControl
    Inherits MenuStrip

You'll have to set references to the System.Windows.Forms.dll and maybe the System.Drawing.dll, depending on what you're doing with the control.


You CAN fix your existing control. All you have to do is click on the "Show All Files..." button in the Solution Explorer, open your control's Designer.vb file and change the Inherits line from System.Windows.Forms.UserControl to System.Windows.Forms.MenuStrip


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionHow convert win path to dos path [modified] Pin
Narenge22-May-07 11:13
Narenge22-May-07 11:13 
AnswerRe: How convert win path to dos path Pin
Dave Herren22-May-07 11:30
Dave Herren22-May-07 11:30 
GeneralRe: How convert win path to dos path Pin
Narenge22-May-07 11:53
Narenge22-May-07 11:53 
GeneralRe: How convert win path to dos path Pin
Dave Kreskowiak22-May-07 12:20
mveDave Kreskowiak22-May-07 12:20 
GeneralRe: How convert win path to dos path Pin
Dave Herren22-May-07 12:25
Dave Herren22-May-07 12:25 
GeneralRe: How convert win path to dos path Pin
Narenge22-May-07 23:06
Narenge22-May-07 23:06 
QuestionPanel + Groupbox Pin
codemunkeh22-May-07 10:03
codemunkeh22-May-07 10:03 
AnswerRe: Panel + Groupbox Pin
Dave Herren22-May-07 11:15
Dave Herren22-May-07 11:15 
GeneralRe: Panel + Groupbox Pin
codemunkeh22-May-07 11:22
codemunkeh22-May-07 11:22 
GeneralRe: Panel + Groupbox Pin
Dave Herren22-May-07 11:55
Dave Herren22-May-07 11:55 
GeneralRe: Panel + Groupbox Pin
codemunkeh22-May-07 12:24
codemunkeh22-May-07 12:24 
GeneralRe: Panel + Groupbox Pin
Dave Herren22-May-07 15:45
Dave Herren22-May-07 15:45 
GeneralRe: Panel + Groupbox Pin
codemunkeh23-May-07 3:11
codemunkeh23-May-07 3:11 
GeneralRe: Panel + Groupbox Pin
Dave Kreskowiak22-May-07 17:53
mveDave Kreskowiak22-May-07 17:53 
GeneralRe: Panel + Groupbox Pin
codemunkeh23-May-07 3:16
codemunkeh23-May-07 3:16 
AnswerNB! Consider it SOLVED Pin
codemunkeh23-May-07 4:52
codemunkeh23-May-07 4:52 
QuestionHelp with an SQL statement... Pin
CCG322-May-07 9:55
CCG322-May-07 9:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.