Click here to Skip to main content
15,905,616 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How we genrate Help File in VB6 Pin
ChandraRam4-Sep-08 1:22
ChandraRam4-Sep-08 1:22 
AnswerRe: How we genrate Help File in VB6 Pin
Rajesh Anuhya4-Sep-08 1:30
professionalRajesh Anuhya4-Sep-08 1:30 
QuestionCutomize Setup VB6 Pin
Amit Battan Ror4-Sep-08 0:06
Amit Battan Ror4-Sep-08 0:06 
AnswerRe: Cutomize Setup VB6 Pin
ChandraRam4-Sep-08 1:19
ChandraRam4-Sep-08 1:19 
GeneralRe: Cutomize Setup VB6 Pin
Amit Battan Ror4-Sep-08 19:24
Amit Battan Ror4-Sep-08 19:24 
GeneralRe: Cutomize Setup VB6 Pin
ChandraRam6-Sep-08 4:43
ChandraRam6-Sep-08 4:43 
QuestionAdd handler during runtime "problem" Pin
Georg Kohler3-Sep-08 19:07
Georg Kohler3-Sep-08 19:07 
AnswerRe: Add handler during runtime "problem" Pin
Dave Kreskowiak4-Sep-08 2:14
mveDave Kreskowiak4-Sep-08 2:14 
Georg Kohler wrote:
If I change in the event handler sub
ByVal sender As ToolStripMenuItem
to
ByVal sender As Object


That's because when the event is fired, it's epecting the handlers signature to be an exact match to what it expects. sender MUST be declared as Object.


Georg Kohler wrote:
The compiler complains inside the sub when trying to read the
[sender.Text] value ...


Obviously, the type Object doesn't have a Text property. So, you have to check for and cast the sender to the type you want. Get used to this, it's pretty common to do this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sentMenuItem As ToolStripMenuItem
        If TypeOf sender Is ToolStopMenuItem Then
            sentMenuItem = DirectCast(sender, ToolStripMenuItem)
        End If
        
        IODataView.CurrentCell.Value = sentMenuItem.Text



A guide to posting questions on CodeProject[^]



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




GeneralRe: Add handler during runtime "problem" Pin
Georg Kohler4-Sep-08 10:44
Georg Kohler4-Sep-08 10:44 
Questionappending an array Pin
DFT13-Sep-08 10:48
DFT13-Sep-08 10:48 
AnswerRe: appending an array Pin
Guffa3-Sep-08 11:15
Guffa3-Sep-08 11:15 
GeneralRe: appending an array Pin
DFT13-Sep-08 11:33
DFT13-Sep-08 11:33 
GeneralRe: appending an array Pin
Guffa3-Sep-08 20:42
Guffa3-Sep-08 20:42 
QuestionHow to disable combobox items Pin
chandrubngit3-Sep-08 9:17
chandrubngit3-Sep-08 9:17 
AnswerRe: How to disable combobox items Pin
Ray Cassick3-Sep-08 9:24
Ray Cassick3-Sep-08 9:24 
AnswerRe: How to disable combobox items Pin
Dominick Marciano3-Sep-08 9:30
professionalDominick Marciano3-Sep-08 9:30 
GeneralRe: How to disable combobox items Pin
chandrubngit3-Sep-08 17:13
chandrubngit3-Sep-08 17:13 
AnswerRe: How to disable combobox items Pin
Paul Conrad3-Sep-08 10:09
professionalPaul Conrad3-Sep-08 10:09 
QuestionPrinting Office without Office Pin
Dominick Marciano3-Sep-08 9:02
professionalDominick Marciano3-Sep-08 9:02 
AnswerRe: Printing Office without Office Pin
Wendelius3-Sep-08 10:44
mentorWendelius3-Sep-08 10:44 
QuestionFlow Charting Component Pin
ExcelMonkey3-Sep-08 8:06
ExcelMonkey3-Sep-08 8:06 
QuestionCatching the hourly system time Pin
MatthysDT3-Sep-08 4:06
MatthysDT3-Sep-08 4:06 
AnswerRe: Catching the hourly system time Pin
Dave Kreskowiak3-Sep-08 10:59
mveDave Kreskowiak3-Sep-08 10:59 
GeneralRe: Catching the hourly system time Pin
MatthysDT3-Sep-08 20:14
MatthysDT3-Sep-08 20:14 
GeneralRe: Catching the hourly system time Pin
Dave Kreskowiak4-Sep-08 1:57
mveDave Kreskowiak4-Sep-08 1:57 

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.