Click here to Skip to main content
15,902,275 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How can i make movable Buttons? Pin
Lek Plepi18-Sep-11 20:54
Lek Plepi18-Sep-11 20:54 
QuestionSave Flexgrid Data in Acess Pin
Lek Plepi16-Sep-11 3:32
Lek Plepi16-Sep-11 3:32 
AnswerRe: Save Flexgrid Data in Acess Pin
Pradeep Shukla16-Sep-11 4:58
professionalPradeep Shukla16-Sep-11 4:58 
GeneralRe: Save Flexgrid Data in Acess Pin
Lek Plepi18-Sep-11 20:53
Lek Plepi18-Sep-11 20:53 
QuestionWhat's wrong with my extension method? Pin
Sonhospa16-Sep-11 2:31
Sonhospa16-Sep-11 2:31 
AnswerRe: What's wrong with my extension method? Pin
ekolis16-Sep-11 3:28
ekolis16-Sep-11 3:28 
GeneralRe: What's wrong with my extension method? Pin
Sonhospa17-Sep-11 4:32
Sonhospa17-Sep-11 4:32 
AnswerRe: What's wrong with my extension method? Pin
Wayne Gaylard16-Sep-11 3:31
professionalWayne Gaylard16-Sep-11 3:31 
I tried it and it seems to be working. Did you Import the correct Namespace into your code file. Here is what I did:-

The Extension
VB
Imports System.Runtime.CompilerServices

Namespace MyExtensions

    Module mdlTraceListenerExtensions

        <Extension()> _
        Public Sub MyWriteLine(ByVal tr As Trace, ByVal LogType As Integer, ByVal message As String)
            If Not tr Is Nothing Then

            End If
        End Sub

    End Module

End Namespace


And the usage:-
VB
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Text
Imports System.IO
Imports CodeProjectVBTest.MyExtensions

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim i As Integer = 19
        Dim tr As Trace
        tr.MyWriteLine(19, "Hello")

    End Sub

End Class


I changed it to MyWriteLine just to ensure I had the correct one, but it works also using WriteLine. maybe you can see where you went wrong from this, otherwise, sorry, I cannot see where you went wrong.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

GeneralRe: What's wrong with my extension method? Pin
Sonhospa17-Sep-11 4:34
Sonhospa17-Sep-11 4:34 
AnswerRe: What's wrong with my extension method? Pin
Simon_Whale16-Sep-11 3:32
Simon_Whale16-Sep-11 3:32 
GeneralRe: What's wrong with my extension method? Pin
Sonhospa17-Sep-11 4:35
Sonhospa17-Sep-11 4:35 
AnswerRe: What's wrong with my extension method? Pin
Luc Pattyn17-Sep-11 5:42
sitebuilderLuc Pattyn17-Sep-11 5:42 
QuestionHow can i get the Calling Number from MS Lync Pin
Michael Lisk16-Sep-11 0:37
Michael Lisk16-Sep-11 0:37 
AnswerRe: How can i get the Calling Number from MS Lync Pin
Simon_Whale16-Sep-11 0:53
Simon_Whale16-Sep-11 0:53 
QuestionDeskBand Objects - VB.NET Pin
Member 812506915-Sep-11 7:18
Member 812506915-Sep-11 7:18 
AnswerRe: DeskBand Objects - VB.NET Pin
Simon_Whale16-Sep-11 0:49
Simon_Whale16-Sep-11 0:49 
QuestionHow to connect vb .net data grid view to a ms access database files Pin
Member 824005315-Sep-11 3:58
Member 824005315-Sep-11 3:58 
AnswerRe: How to connect vb .net data grid view to a ms access database files Pin
Luc Pattyn15-Sep-11 6:23
sitebuilderLuc Pattyn15-Sep-11 6:23 
GeneralRe: How to connect vb .net data grid view to a ms access database files Pin
Manar.A21-Sep-11 6:01
Manar.A21-Sep-11 6:01 
GeneralRe: How to connect vb .net data grid view to a ms access database files Pin
Luc Pattyn21-Sep-11 6:15
sitebuilderLuc Pattyn21-Sep-11 6:15 
QuestionLeft$, Right$, Trim$, "$" Advice. Pin
Clark Kent12314-Sep-11 11:00
professionalClark Kent12314-Sep-11 11:00 
AnswerRe: Left$, Right$, Trim$, "$" Advice. Pin
Dave Doknjas14-Sep-11 11:49
Dave Doknjas14-Sep-11 11:49 
GeneralRe: Left$, Right$, Trim$, "$" Advice. Pin
Nagy Vilmos15-Sep-11 0:13
professionalNagy Vilmos15-Sep-11 0:13 
GeneralRe: Left$, Right$, Trim$, "$" Advice. Pin
Clark Kent12315-Sep-11 2:18
professionalClark Kent12315-Sep-11 2:18 
AnswerRe: Left$, Right$, Trim$, "$" Advice. Pin
MicroVirus15-Sep-11 4:25
MicroVirus15-Sep-11 4:25 

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.