Click here to Skip to main content
15,921,295 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Class Not Registered Pin
Paramhans Dubey7-Jun-07 6:25
professionalParamhans Dubey7-Jun-07 6:25 
GeneralRe: Class Not Registered Pin
Dave Kreskowiak7-Jun-07 6:27
mveDave Kreskowiak7-Jun-07 6:27 
GeneralRe: Class Not Registered Pin
Paramhans Dubey7-Jun-07 19:50
professionalParamhans Dubey7-Jun-07 19:50 
GeneralRe: Class Not Registered Pin
Dave Kreskowiak8-Jun-07 3:34
mveDave Kreskowiak8-Jun-07 3:34 
QuestionWill VB.NET 2.0 allow dynamically created objects? Pin
Marcus J. Smith7-Jun-07 2:54
professionalMarcus J. Smith7-Jun-07 2:54 
AnswerRe: Will VB.NET 2.0 allow dynamically created objects? Pin
Colin Angus Mackay7-Jun-07 2:58
Colin Angus Mackay7-Jun-07 2:58 
GeneralRe: Will VB.NET 2.0 allow dynamically created objects? Pin
Marcus J. Smith7-Jun-07 4:40
professionalMarcus J. Smith7-Jun-07 4:40 
GeneralRe: Will VB.NET 2.0 allow dynamically created objects? Pin
Polymorpher7-Jun-07 6:46
Polymorpher7-Jun-07 6:46 
If i understand your question right, then yes you can. I needed to do something similar for a button bar for a project...I needed to be able to take a datatable and insert each row into a button bar as a button...There is alot more code then this for the entire process, but maybe this will give you an idea...

Imports DevExpress.XtraEditors<br />
Imports System.Drawing<br />
Imports ZipsUtils<br />
<br />
Public Class ButtonBarButton<br />
<br />
#Region " Const "<br />
    Public Const kSpacing As Integer = 6<br />
<br />
    Public Const kButtonTopH As Integer = 3<br />
    Public Const kButtonLeftV As Integer = 6<br />
<br />
    Public Const kLabelTopH As Integer = 102<br />
    Public Const kLabelLeftV As Integer = 6<br />
    Public Const kLabelHeight As Integer = 13<br />
#End Region<br />
<br />
#Region " Variables "<br />
    Private mDevButton As SimpleButton<br />
    Private mLabel As DevExpress.XtraEditors.LabelControl<br />
    Private mButton As IZipsButtonBarButton<br />
    Private mContainer As XtraScrollableControl<br />
    Private mUseLabel As Boolean<br />
#End Region<br />
<br />
#Region " Propertys "<br />
    Public ReadOnly Property DevButton() As SimpleButton<br />
        Get<br />
            Return mDevButton<br />
        End Get<br />
    End Property<br />
<br />
    Public ReadOnly Property Label() As DevExpress.XtraEditors.LabelControl<br />
        Get<br />
            Return mLabel<br />
        End Get<br />
    End Property<br />
<br />
    Public ReadOnly Property ButtonBarButton() As IZipsButtonBarButton<br />
        Get<br />
            Return mButton<br />
        End Get<br />
    End Property<br />
#End Region<br />
<br />
#Region " Constructor "<br />
    Public Sub New(ByVal theButton As IZipsButtonBarButton, ByVal container As XtraScrollableControl, ByVal allignVerticaly As Boolean, ByVal theSize As Size, ByVal useLabels As Boolean)<br />
        mButton = theButton<br />
        mContainer = container<br />
        mUseLabel = useLabels<br />
<br />
        Dim numControls As Integer = mContainer.Controls.Count<br />
        If Not allignVerticaly Then<br />
            If mUseLabel Then<br />
                Dim x As Integer = CInt(((numControls >> 1) * (theSize.Width + kSpacing)) + kSpacing)<br />
<br />
                CreateButton(New Point(x, kButtonTopH), New Size(theSize.Width, theSize.Height), (numControls >> 1))<br />
                CreateLabel(New Point(x, kLabelTopH), New Size(theSize.Width, kLabelHeight), (numControls >> 1))<br />
            Else<br />
                Dim x As Integer = CInt(numControls * (theSize.Width + kSpacing))<br />
<br />
                CreateButton(New Point(x, kButtonTopH), New Size(theSize.Width, theSize.Height), numControls)<br />
            End If<br />
        Else<br />
            If mUseLabel Then<br />
                Dim y As Integer = ((kSpacing + ((numControls >> 1) * (theSize.Height + kSpacing))) + (kSpacing + ((numControls >> 1) * (kLabelHeight + kSpacing))))<br />
<br />
                CreateButton(New Point(kButtonLeftV, y), New Size(theSize.Width, theSize.Height), (numControls >> 1))<br />
                CreateLabel(New Point(kButtonLeftV, ((y + theSize.Height) + (kSpacing >> 1))), New Size(theSize.Width, kLabelHeight), (numControls >> 1))<br />
            Else<br />
                Dim y As Integer = (kSpacing + (numControls * (theSize.Height + kSpacing)))<br />
<br />
                CreateButton(New Point(kButtonLeftV, y), New Size(theSize.Width, theSize.Height), numControls)<br />
            End If<br />
        End If<br />
    End Sub<br />
#End Region<br />
<br />
#Region " Subs "<br />
    Public Sub CreateButton(ByVal location As Point, ByVal size As Size, ByVal incrementSeed As Integer)<br />
        Dim setImg As Image = Nothing<br />
        If Not mButton.Image Is Nothing Then<br />
            setImg = DBConLite.GetResizedImage(mButton.Image, New Size(size.Width, size.Height))<br />
        End If<br />
<br />
        mButton.Size = size<br />
<br />
        mDevButton = New DevExpress.XtraEditors.SimpleButton<br />
        With mDevButton<br />
            .Location = location<br />
            .Name = "SimpleButton" & incrementSeed<br />
            .Size = size<br />
            .TabIndex = 0<br />
<br />
            If Not setImg Is Nothing Then<br />
                .Image = setImg<br />
            Else<br />
                .Text = mButton.Name<br />
            End If<br />
<br />
            .Tag = Me<br />
        End With<br />
<br />
        mContainer.Controls.Add(mDevButton)<br />
    End Sub<br />
<br />
    Public Sub CreateLabel(ByVal location As Point, ByVal size As Size, ByVal incrementSeed As Integer)<br />
        mLabel = New DevExpress.XtraEditors.LabelControl<br />
        With mLabel<br />
            .Appearance.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))<br />
            .Appearance.Options.UseFont = True<br />
            .Appearance.Options.UseTextOptions = True<br />
            .Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center<br />
            .AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None<br />
            .Location = location<br />
            .Name = "LabelControl" & incrementSeed<br />
            .Size = size<br />
            .TabIndex = 0<br />
            .Text = mButton.Name<br />
            .Tag = Me<br />
        End With<br />
<br />
        mContainer.Controls.Add(mLabel)<br />
    End Sub<br />
<br />
    Public Sub Dispose()<br />
        mDevButton.Dispose()<br />
<br />
        If mUseLabel Then<br />
            mLabel.Dispose()<br />
        End If<br />
<br />
        mDevButton = Nothing<br />
        mLabel = Nothing<br />
        mButton = Nothing<br />
    End Sub<br />
#End Region<br />
<br />
End Class


Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so

QuestionAccess VBA, how to call a method on a subform? Pin
Dan Neely7-Jun-07 2:48
Dan Neely7-Jun-07 2:48 
Questionhow do i remove selected row permanently from sql database through datagrid? Pin
sathyan_82947-Jun-07 2:27
sathyan_82947-Jun-07 2:27 
AnswerRe: how do i remove selected row permanently from sql database through datagrid? Pin
Dave Kreskowiak7-Jun-07 4:05
mveDave Kreskowiak7-Jun-07 4:05 
QuestionInserting text in a RichTextBox at a particular location Pin
ajithmanmadhan7-Jun-07 2:01
ajithmanmadhan7-Jun-07 2:01 
AnswerRe: Inserting text in a RichTextBox at a particular location Pin
Dave Kreskowiak7-Jun-07 4:01
mveDave Kreskowiak7-Jun-07 4:01 
Questionhow to send screen resolution on serial port Pin
farah mazhar7-Jun-07 1:45
farah mazhar7-Jun-07 1:45 
AnswerRe: how to send screen resolution on serial port Pin
Dave Kreskowiak7-Jun-07 3:51
mveDave Kreskowiak7-Jun-07 3:51 
QuestionDebugging issue. Pin
Ron.S7-Jun-07 1:21
Ron.S7-Jun-07 1:21 
AnswerRe: Debugging issue. Pin
Christian Graus7-Jun-07 1:55
protectorChristian Graus7-Jun-07 1:55 
AnswerRe: Debugging issue. Pin
Dave Kreskowiak7-Jun-07 3:49
mveDave Kreskowiak7-Jun-07 3:49 
GeneralRe: Debugging issue. Pin
revi227-Jun-07 5:01
revi227-Jun-07 5:01 
Jokewishes Pin
arafath76-Jun-07 23:51
arafath76-Jun-07 23:51 
GeneralRe: wishes Pin
Christian Graus6-Jun-07 23:57
protectorChristian Graus6-Jun-07 23:57 
GeneralRe: wishes Pin
Johan Hakkesteegt7-Jun-07 21:26
Johan Hakkesteegt7-Jun-07 21:26 
QuestionTaskbar icon Pin
giorget6-Jun-07 23:09
giorget6-Jun-07 23:09 
AnswerRe: Taskbar icon Pin
Dave Kreskowiak7-Jun-07 1:28
mveDave Kreskowiak7-Jun-07 1:28 
QuestionIcon Pin
Socheat.Net6-Jun-07 22:45
Socheat.Net6-Jun-07 22:45 

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.