the_carpenter 21 Junior Poster in Training

Anything is possible.

But you're not very clear in the functionality.

So you want to read an excel file. Easy enough.

Then you want to... read an .ini file or create an .ini file? What's the .ini file going to contain?

Then you want to take the information that you just combined in the .ini from the excel sheet and launch an executable associated with .ini files in general or that .ini file?

Details, man... give us some more details.

the_carpenter 21 Junior Poster in Training

When I was in college we abbreviated our major by what our specialty was.

ie, EEE, CE, ME, HE, AE etc.

We didn't just have an Engineering Department. We had a Electrical/Electronic Engineering Department, a Civil Engineering Department, etc.

I've never known anyone to graduate as just an engineer, so forgive me for not grasping on to the concept of you graduating as just an engineer. Or should I say you'll be an "engg".

Give us some details. We can't read your mind.

the_carpenter 21 Junior Poster in Training

More detail please.

What is menu_cmbselectedIndex? A menu, a combobox, or a combobox.selectedIndex property? What does it hold and where is this textfile?

Give us some code that you've already attempted to put together.

the_carpenter 21 Junior Poster in Training

How about you giving us a little more detail in what it is you need?

What is engg?

I can give you call kinds of topics... but without more specific info as to their complexity, originality, intent, etc. it would be pointless.

the_carpenter 21 Junior Poster in Training

Don't think that moving to Visual Studio .net is going to protect your code.

Redgate's .Net Reflector (http://www.red-gate.com) can quickly show you how open .Net executables and libraries can be.

I have used one tool to combat code theft by decompilers and hacks. So I maybe a bit bias when it comes to my opinion.

A company called Eziriz (http://www.eziriz.com) has a tool called .Net Reactor which completely encrypts any .exe or .dll compiled in Visual Studio .net but still makes the .exe completely usable.

the_carpenter 21 Junior Poster in Training

It's only doing one or the other because that's what you told it to do.

Study the code.

On line 6 you are saying if d is between 0 and 360 then calculate r

On line 11 with your elseif you are saying ...

if d isn't between 0 and 360 then check if r is between 0 and Pi calculate d

get ride of the Elseif

make it just an If

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim r, d As Double
        Const Pi = 3.141596
        Dim dblTempr as Double = Val(rtb.Text)
        Dim dblTempd as Double = Val(dtb.Text)
        If 0 < dblTempd < 360 Then
            r = dblTempd / 180 * Pi
            rtb.Text = Format(r, "0.00")
        End If
        If 0 < dblTempr < Pi Then
            d = dblTempr / Pi * 180
            dtb.Text = Format(d, "0.00")
        End If
    End Sub

But still you have logic problem if both text boxes are filled.

But you already know that.

the_carpenter 21 Junior Poster in Training

What doing the conversion? Visual Studio?

Try Artinsoft Visual Basic Upgrade Companion.

They have a free 1 month/ 10,000 lines of code limit. But it could get you further along.

Simran Kaur commented: was helpful +1
the_carpenter 21 Junior Poster in Training

Cam you be a little more specific?

Are you trying to create an plain text HTML editor?

the_carpenter 21 Junior Poster in Training

Your missing something on your btnUpdate_Click

Look at the line that reads...

ds.Tables("Personnel").Rows(inc).Item(0) = txtPersonnelID

It's missing something, isn't it?

It should be the following...

ds.Tables("Personnel").Rows(inc).Item(0) = txtPersonnelID.Text
the_carpenter 21 Junior Poster in Training

Why are you doing a directcast? Where did you get that from?

Why aren't you ending the bindingsource's Edit by using a .EndEdit?

Me.Validate()
Me.Product_DetailsBindingSource.EndEdit()
Me.Product_DetailsTableAdapter.Update(Me.WhateveryourDataSetisCalled.Product_Details)
the_carpenter 21 Junior Poster in Training

I know I'm doing this wrong... but in my current state of mind I can't think of exactly where I'm getting my information crossed.

Anyway... I played around with the IndexOf function in the clsFunctionXref

and this is what I got replace the IndexOf function with this one...

Public Function IndexOf(ByVal value As Object) As Integer Implements System.Collections.IList.IndexOf
        SyncLock Me.SyncRoot
            Dim tmpFnInfo As New clsFunctionInfo
            Dim tmpFunctionNumber As Integer
            Dim tmpidx As Integer = -1

            tmpFnInfo = DirectCast(value, clsFunctionInfo)
            tmpFunctionNumber = tmpFnInfo.IFunctionNumber

            For Each obj In _colFunctionInfo
                tmpFnInfo = DirectCast(obj, clsFunctionInfo)
                If tmpFunctionNumber = tmpFnInfo.IFunctionNumber Then
                    tmpidx = tmpFnInfo.IdxFunction
                    Exit For

                End If
            Next
            Return tmpidx
        End SyncLock

    End Function

So then I put a textbox and a button on the same form with the listbox

And then added this to the button_click

Dim iLookupNumber As Integer = 0

        Dim tmpFnInfo As New clsFunctionInfo
        Dim iReturnIdx As Integer = -1
        If TextBox1.Text.Length > 0 Then
            Try
                iLookupNumber = Convert.ToInt32(TextBox1.Text.ToString)

            Catch ex As Exception
                TextBox1.Text = ""
                MessageBox.Show("Enter a number, please.", "Come on... what are you doing here?", MessageBoxButtons.OK, MessageBoxIcon.Warning)

            End Try
            If iLookupNumber <> 0 Then
                tmpFnInfo.IFunctionNumber = iLookupNumber

                iReturnIdx = _objFnXtef.IndexOf(tmpFnInfo)
                If iReturnIdx <> -1 Then
                    ListBox1.SelectedIndex = iReturnIdx - 1
                End If


            End If
        End If

Completely insane, bassakwards and and screwed up but it works....

the_carpenter 21 Junior Poster in Training

mmm... ok...
without visual studio here... I can't debug the code...

Let me see if I have the visual studio disk here... and I will install it and figure this out...

I think it has something to do with the...

Default Public Property Item(ByVal index As Integer) As Object Implements System.Collections.IList.Item

being declared as an object and not as a clsFunctionInfo

I'll get back to you.

the_carpenter 21 Junior Poster in Training

I'm sure there is easier ways to do this same task... but the reason I would do it this way is so you can add in more complexity to the clsFunctionXref class.

Such as a SaveFile subroutine, or more logic to the iFunctionNumber such as verification of format or checks that it doesn't already exist, etc.

the_carpenter 21 Junior Poster in Training

easy...

You have the function number...

dim iStartUpFunctionNumber as integer = 422

combobox1.selectedindex =_objFnXtef.item(iStartUpFunctionNumber).IdxFunction

I think this should work. I didn't have VIsual Studio open to test it...

of course the above code will only work in the form because the object _objFnXtef is only declared in the form's context. (ooo... I just noticed a misspelling in the variable name but it doesn't matter)

the_carpenter 21 Junior Poster in Training

Since the listbox implements IList, make a class that implements IList and connected to the listbox's datasource.

For example:
Here is your basic class

Public Class clsFunctionInfo

    Private _idxFunction As Integer

    Public Property IdxFunction() As Integer
        Get
            Return _idxFunction
        End Get
        Set(ByVal value As Integer)
            _idxFunction = value
        End Set
    End Property
    Private _strFunction As String

    Public Property StrFunction() As String
        Get
            Return _strFunction
        End Get
        Set(ByVal value As String)
            _strFunction = value
        End Set
    End Property

    Private _iFunctionNumber As Integer
    Public Property IFunctionNumber() As Integer
        Get
            Return _iFunctionNumber
        End Get
        Set(ByVal value As Integer)
            _iFunctionNumber = value
        End Set
    End Property

End Class

Then you make a class to manage your collection of the above classes

Imports Microsoft.VisualBasic.FileIO

Public Class clsFunctionXref
    Implements System.Collections.IList

    Private _colFunctionInfo As New Collection

    Private _filePath As String
    Public Property FilePath() As String
        Get
            Return _filePath
        End Get
        Set(ByVal value As String)
            _filePath = value
        End Set
    End Property



    Public Sub New(ByVal filename As String)
        _filePath = filename

        Dim _idx As Integer = 1
        Dim fields As String()
        Dim delimiter As String = ","
        Dim iFnx As Integer
        Using parser As New TextFieldParser(filename)
            parser.SetDelimiters(delimiter)
            While Not parser.EndOfData
                ' Read in the fields for the current line
                fields = parser.ReadFields()

                Try
                    iFnx = Convert.ToInt16(fields(0).ToString)
                Catch ex As Exception
                    MessageBox.Show("Error reading file.  " & ex.ToString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    Exit Sub
                End Try

                Dim objFunction As New clsFunctionInfo
                objFunction.IdxFunction = _idx
                objFunction.IFunctionNumber = iFnx
                objFunction.StrFunction = fields(1).ToString
                Me.Add(objFunction)
                _idx += 1

            End While
        End …