Discussion:
visual studio controls
(too old to reply)
colmkav
2013-02-20 22:52:31 UTC
Permalink
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as the user interface. I want to replace the interface with a VB.net project using VB.net controls instead. which would be the best control to use in my application?

My current spreadsheet has a start button and a list of jobs with a check box for each specifying whether the job is to be run or not.
Karl E. Peterson
2013-02-20 23:21:06 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as
the user interface. I want to replace the interface with a VB.net project
using VB.net controls instead. which would be the best control to use in my
application?
"Self-", I'd have to say. WTH would you want to do that?
--
.NET: It's About Trust!
http://vfred.mvps.org
Auric__
2013-02-21 01:23:25 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel
Workbook as the user interface. I want to replace the interface with a
VB.net project using VB.net controls instead. which would be the best
control to use in my application?
Depending on exactly what you're trying to do, you could probably just use a
DataGridView control.
Post by colmkav
My current spreadsheet has a start button and a list of jobs with a
check box for each specifying whether the job is to be run or not.
This group is almost entirely people who are using pre-.Net VB (i.e. VB6 and
older). For future .Net questions, you could *try* asking here:

microsoft.public.dotnet.languages.vb

...but that group is pretty dead nowadays.
--
This world is mine, in time.
GS
2013-02-21 03:46:07 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as
the user interface. I want to replace the interface with a VB.net project
using VB.net controls instead. which would be the best control to use in my
application?
My current spreadsheet has a start button and a list of jobs with a check box
for each specifying whether the job is to be run or not.
You could use a 3rd party spreadsheet control if you need spreadsheet
features/functionality. If not then a grid control as _Auric suggests.

I bought Farpoint's Spread.ocx ActiveX control back when MS released
the Ribbon so I could make all my Excel-based apps standalone Windows
apps using VB6. It works great! (Farpoint is now GrapeCity, and they do
have a dotnet version of the control. It's not cheap!!)

In addition to Karl's comment, I can't imagine why you'd want to go
with dotnet if you're already familiar with VBA since dotnet's an
entirely different language (despite name similarities). VB6 is as
close as you'll get to VBA, and most all of the code is portable beteen
the two!

I went back to Excel-based apps because that's what clients wanted
(popularity rules in the corporate world), so I've settled on combining
VB6 and Excel via automation. I still use my Spread.ocx for proprietary
projects, though.
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
colmkav
2013-02-21 09:17:04 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as the user interface. I want to replace the interface with a VB.net project using VB.net controls instead. which would be the best control to use in my application?
My current spreadsheet has a start button and a list of jobs with a check box for each specifying whether the job is to be run or not.
thanks for the responses. The reason why I am doing it in VB.NET is because I am trying to learn VB.NET in order to improve my skill set so I have more employment opportunities.
colmkav
2013-02-21 09:20:23 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as the user interface. I want to replace the interface with a VB.net project using VB.net controls instead. which would be the best control to use in my application?
My current spreadsheet has a start button and a list of jobs with a check box for each specifying whether the job is to be run or not.
btw, is there any good side you can recommend for example applications which I can look at to see what choices are made for such decisions ie choosing which controls to implement for certain situations?
Deanna Earley
2013-02-21 09:28:34 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel
Workbook as the user interface. I want to replace the interface with
a VB.net project using VB.net controls instead. which would be the
best control to use in my application?
My current spreadsheet has a start button and a list of jobs with a
check box for each specifying whether the job is to be run or not.
As I'm already damned to hell, I might as well say:
Use a ListView with the CheckBoxes property set to true.

I expect the other grid controls also have a similar property.
--
Deanna Earley (***@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
GS
2013-02-21 18:07:37 UTC
Permalink
Post by Deanna Earley
Use a ListView with the CheckBoxes property set to true
I wish I thought of that (or a listbox)!<g> It certainly makes for a
simple solution.
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
colmkav
2013-02-21 19:10:43 UTC
Permalink
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as the user interface. I want to replace the interface with a VB.net project using VB.net controls instead. which would be the best control to use in my application?
My current spreadsheet has a start button and a list of jobs with a check box for each specifying whether the job is to be run or not.
thanks, I have chosen the listview.

A follow up question: I am conceptually trying to think what I should do in order to keep the results of the form somehow. When I used an Excel workbook as the interface I would store values such as the time the job was run etc. In Excel, it was simply a case of saving the workbook to keep these details of the last run but how would I do this with a form?
GS
2013-02-21 19:22:17 UTC
Permalink
Post by colmkav
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook as
the user interface. I want to replace the interface with a VB.net project
using VB.net controls instead. which would be the best control to use in my
application?
My current spreadsheet has a start button and a list of jobs with a check
box for each specifying whether the job is to be run or not.
thanks, I have chosen the listview.
A follow up question: I am conceptually trying to think what I should do in
order to keep the results of the form somehow. When I used an Excel workbook
as the interface I would store values such as the time the job was run etc.
In Excel, it was simply a case of saving the workbook to keep these details
of the last run but how would I do this with a form?
I use a delimited text file with field names in the 1st line. This lets
me dump the data into an array OR use ADODB recordset. In the case of
using the aforementioned Spread.ocx, it imports the data directly.
Using the listview you'd need to populate columns with a For...Next
loop since that's not a grid control.
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
ralph
2013-02-21 19:43:59 UTC
Permalink
On Thu, 21 Feb 2013 11:10:43 -0800 (PST), colmkav
Post by colmkav
A follow up question: I am conceptually trying to think what I should do in order
to keep the results of the form somehow. When I used an Excel
workbook as the interface I would store values such as the time the
job was run etc. In Excel, it was simply a case of saving the
workbook to keep these details of the last run but how would I do
this with a form?
There are several methods... (in addition to GS's advice)

1) Use SaveSettings - save to registry
2) Store the values in "hidden" cells
3) Store in Public Declarations
4) Set the Control values as the default values

And probably a few others I can't think atm. <g>
DaveO
2013-02-22 09:55:27 UTC
Permalink
Post by colmkav
Post by colmkav
Hi, I am trying to convert an old VBA project that uses an Excel Workbook
as the user interface. I want to replace the interface with a VB.net
project using VB.net controls instead. which would be the best control to
use in my application?
My current spreadsheet has a start button and a list of jobs with a check
box for each specifying whether the job is to be run or not.
thanks, I have chosen the listview.
A follow up question: I am conceptually trying to think what I should do in
order to keep the results of the form somehow. When I used an >Excel
workbook as the interface I would store values such as the time the job was
run etc. In Excel, it was simply a case of saving the >workbook to keep
these details of the last run but how would I do this with a form?
Hi

This simple function will make a string with which can then be saved to
disc.
I'll leave you to work out the reverse needed to load it back to a LV.

Public Function ReadLV(LVName As ListView) As String
Dim x_Cell As Integer
Dim y_Cell As Integer

With LVName
For y_Cell = 1 To .ListItems.Count
ReadLV = ReadLV & .ListItems(y_Cell).Text
For x_Cell = 1 To .ColumnHeaders.Count - 1
ReadLV = ReadLV & vbTab & .ListItems(y_Cell).SubItems(x_Cell)
Next
ReadLV = ReadLV & vbCrLf
Next
End With
End Function

If it's a really long list or one that has a lot of columns, you'll probably
want to modify it to use a stringbuilder of some kind.

Regards
DaveO.

Loading...