Anyway to rename DLL keys?

richt

Member
Licensed User
Hi there,

I'm making use of the Listview.DLL (the alternative to the table control) for a financial account window in my desktop app.

I'd also like to use the ControlsExDesktop.DLL to make use of the statustoolbar function. Unfortunately because both DLLs share a key (listview) I can only use one or the other currently.

Does anyone know a way around this?

Thanks in advance,

Rich
 

richt

Member
Licensed User
Ah, ok.

Guess I'll have to move the financial stuff into an external App and call it using the Shell command.

Thanks for the speedy response as ever.

Cheers,
Rich
 

taximania

Well-Known Member
Licensed User
Longtime User
Ask the person who wrote ControlsExDesktop.cs's permission if they will allow you to recompile their code to produce a new .DLL

And learning how to create your own .dll files is a must :)

If this is for your personal use, it probably won't be problem
with the original author.

If you wish to distribute the new .dll or .cs, some recognition
to the original author is usually the done thing to do.
 

berndgoedecke

Active Member
Licensed User
Longtime User
Using Controlsex Listview for Sqlite Tables

Hello richt,
why do you prefer Listview.dll? There is no cs file and it is not compielable.
In the beginning of my B4P practice I used ListView.dll because there was no other. But with the ControlsEx you are more flexible and with doorex.dll you can add some functions like edit the Items etc.

If you need some suggestions, letme know.

Best Regards

berndgoedecke
 

richt

Member
Licensed User
Hello richt,
why do you prefer Listview.dll? There is no cs file and it is not compielable.
In the beginning of my B4P practice I used ListView.dll because there was no other. But with the ControlsEx you are more flexible and with doorex.dll you can add some functions like edit the Items etc.

If you need some suggestions, letme know.

Best Regards

berndgoedecke

Hi berndgoedecke,

I'm using listview.dll as an enhanced table basically. I wanted to be able to have alternative row colours, double click events for reconciling payments, a bit like this (see attachment).

I've been developing a desktop app in basic4ppc for internal use only at my recording studio.

Cheers,
Rich
 

richt

Member
Licensed User
I've also just worked out how to unblock the help files on Windows 7 and read Agraham's statement about commercial usage of his libraries.

Agraham, I've developed an app for internal use at my recording studio, it's a commercial venture but the app has limited usage outside of my business. I make use of a couple of your libraries, what would you like me to do?

Cheers,
RIch
 

agraham

Expert
Licensed User
Longtime User
No problem using any of my desktop or device libraries if the application was developed and used for internal use in your own business.

No problem using any of my libraries for a device application you intend to sell commercially except the Jpeg library needs a licence from a third party as explained in the help.

No problem using any of my libraries except FormExDesktop for a desktop application you intend to sell commercially except the Jpeg library needs a licence from a third party as explained in the help.

However if you intend to sell a commercial desktop application you might want to use FormExDesktop to make it look more like a regular desktop application. In that case we need to come to an arrangement.
 

berndgoedecke

Active Member
Licensed User
Longtime User
There are no limitations in ControlsEx.ListView

Hello richt again,
have a look at the attached jpg. Is it that what you need?
If you do a Table with ListView you can use lv.GetItemBackColor and lv.GetItemBackColor to do color your Items.
Here, a little code snippet:

For i =0 To Main.SelSpAnz-1 '<--SelSpAnz = columns count
lvTab.AddColumnHeader (Main.SelSpNam(i)) '<-- Build the Columns Header
Next
Main.SqlStr = "Select " & Main.SelStr & " FROM [" & Main.AktTab & "] WHERE OID >= " & Main.c & " LIMIT " & Lim '<--Get the datas row by row
Main.DatTab(Main.SqlStr, Lim) '<-- A function to get the datas
Dim TRow(Main.SelSpAnz) '<--build an array with column count items
For j = 0 To Lim-1 '<--Lim = limit of Rows
For i = 0 To Main.SelSpAnz-1
TRow(i) = Main.TCells(i,j) 'Fill the Row with datas
Next
lvTab.AddItemArray(TRow()) ' Add the Item
If j Mod 2 = 0 Then
lvTab.SetItemBackColor(j, cSilver) 'If Item Index is even, color is silver
Else
lvTab.SetItemBackColor(j, cWhite) 'If Item Index is odd, color is white
End If
Next
lvw = 0
For i =0 To Main.SelSpAnz -1
lvTab.SetColumnWidth(i, -2) 'SetColumn Width automaticly
lvW = lvW + lvTab.GetColumnWidth(i)
Next

I hope It helps.



best regards

berndgoedecke
 

Attachments

  • Stripe-Table.JPG
    Stripe-Table.JPG
    18.3 KB · Views: 236
Last edited:

richt

Member
Licensed User
Agraham, that's excellent, thanks as ever for your speedy response.

berndgoedecke, I'm attempting to re-write my code using ControlExDesktop's Listview but I'm having some problems. Here's a snippet of my code below, all it's producing is the value of the first column ('R' for reconciled in my case). I've attached a screenshot.

Here's the code:

'Clean down
Main.Listview.Clear

'Add headers
main.Listview.AddColumnHeader("R")
main.Listview.AddColumnHeader("Date")
main.Listview.AddColumnHeader("Payee")
main.Listview.AddColumnHeader("Reference")
main.Listview.AddColumnHeader("Type")
main.Listview.AddColumnHeader("Amount")
main.Listview.AddColumnHeader("Balance")

'Get the dates
DateFormat("yyyy-mm-dd")
querystartdate = Date(main.SelectPaymentsFromDate.Value)
queryenddate = Date(main.SelectPaymentsToDate.Value)

'Get payments from the database

Main.Connection.BeginTransaction

If Main.ShowPaymentsSelect.SelectedIndex = 0 Then
Main.Command.CommandText = "select * from t_InvoicePayments where paymentdate between '" & querystartdate & "' and '" & queryenddate & "' order by paymentdate ASC"
Else If Main.ShowPaymentsSelect.SelectedIndex = 1 Then
Main.Command.CommandText = "select * from t_InvoicePayments where reconciled='R' and paymentdate between '" & querystartdate & "' and '" & queryenddate & "' order by paymentdate ASC"
Else If Main.ShowPaymentsSelect.SelectedIndex = 2 Then
Main.Command.CommandText = "select * from t_InvoicePayments where reconciled=' ' and paymentdate between '" & querystartdate & "' and '" & queryenddate & "' order by paymentdate ASC"
End If

'Fetch data
Main.Reader.Value = Main.Command.ExecuteReader

Balance = 0

Do While Main.Reader.ReadNextRow = True
RecStatus = Main.Reader.GetValue(0)
InvoiceID = Main.Reader.GetValue(1)
DateFormat("yyyy-mm-dd")
PaymentDate = Main.Reader.GetValue(2)
Ticks = DateParse(PaymentDate)
DateFormat("dd/mm/yyyy")
PaymentDate = Date(Ticks)
PaymentType = Main.Reader.GetValue(3)
Amount = Main.Reader.GetValue(4)

Balance = Balance + Amount

Main.Cells(0) = RecStatus
Main.Cells(1) = PaymentDate
Main.Cells(2) = "-"
Main.Cells(3) = InvoiceID
Main.Cells(4) = PaymentType
Main.Cells(5) = Format(Amount,"N2")
Main.Cells(6) = Format(Balance,"N2")

Main.Listview.AddItemArray(Main.Cells())

Loop

DateFormat("yyyy-mm-dd")

Main.Reader.Close
Main.Connection.EndTransaction


Thanks in advance,

Rich
 

Attachments

  • controlexlistviewfirstattempt.jpg
    controlexlistviewfirstattempt.jpg
    24.9 KB · Views: 208
Top