|
this can be good solution:
you can specify new class that has 4 property for your 4 specifications
now you can get collection of Array list based on your class define above,
and at last you have an arryalist that have items corresponds with your special class.
i think you can implement this yourself but for implement details post here again.
Human knowlege belongs to the world
|
|
|
|
|
Hi, Thank you so much for the reply. I have done as you said. I have a class file which has 4 private variables declared, and then I have 4 properties for each.
The property code for each looks like this:
Public Property Artist() As String
Get
Return strArtist
End Get
Set(ByVal Value As String)
strArtist = Value
End Set
End Property
These are the steps I have taken:
In the Main form,
OnButtonClick
- Dim obj As New cls
- obj.Variable1 = Me.Textbox1.Text
- obj.Variable2 = Me.Textbox2.Text
- obj.Variable3 = Me.Textbox3.Text
- obj.Variable4 = Me.Textbox4.Text
- arrList.Add(obj) ???? Is this correct?
- Me.Listbox1.Items.Add(Textboxe1/2/3/4.Text)
THEN,
OnListBoxSelectIndexChanged
- I need to retrieve the values from the arraylist which at this point holds the class instance
- Then I need to put the data back into the original Textboxes. This is the part I am stuck at
Thanks in advance
|
|
|
|
|
Kindly assist me rectify VB 6.0 code below:
Shell("xcopy c:\Software\Zimbabwe c:\Program Files\Zimbabwe.* /-Y")
I want to copy the folder called Zimbabwe to Program Files but nothing seems to be happening.
|
|
|
|
|
i believe the problem is that shell assumes you know the location of xcopy. so by not specifying a path for xcopy it's looking at the local directory instead of c:\windows\system32, so put the path in for xcopy
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
The XCOPY command should be:
XCOPY C:\Software\Zimbabwe\*.* C:\Program Files\Zimbabwe\*.* /Y
|
|
|
|
|
Dave Kreskowiak wrote: XCOPY C:\Software\Zimbabwe\*.* C:\Program Files\Zimbabwe\*.* /Y
I tried this but still the results are negative. When I try this same command from the DOS prompt I get an error message that says: Invalid number of parameters. I think the problem could be on the spacing of the folder name Program Files but then how can this be rectified? Pease assist.
|
|
|
|
|
Whoops. Any path names with spaces in them should have quote marks around them.
XCOPY C:\Software\Zimbabwe\*.* "C:\Program Files\Zimbabwe\*.*" /Y
|
|
|
|
|
Hi..
ive read multiple articles through multiple location in google and somewhat understand what threading can do.. however..
how do i decide where and when my app will need it ???
for example.. the only place i can think of where my app will do heavy work is producing reports through dlgprintpreview.etc is that something i need to consider using threading for ..
any advice would be much appreciated.
Regards
Robbo
|
|
|
|
|
Simply put, if you are waiting for more than one thing to happen, you use threading.
If you both want to wait for a process to finish, and wait for user input at the same time, you use a background thread for the process. If you run the process in the main thread, the program will not respond to any user input at all until the process is finished.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
multi-threading is all about performance; there are two reasons to add some threads
(although these reasons often converge):
1. overall behavior
to increase parallellism: you want several things to go on at the same time, without
one affecting the other more than necessary (they inherently interfere with each other
because of limited resources, such as CPU cycles or memory bandwidth).
So you add threads to decouple logically distinct activities.
Example: one thread can do a database access, another an Internet fetch, yet another
a complex computation. It would not make much sense to let the database activity wait
on an unrelated Internet reply or an unrelated computation.
The most obvious wish for parallellism is in the GUI: you want to be able to
move, resize, close, ... your form(s) at all times, don't you? Therefore an interactive
application should reserve one thread (normally the main thread, also called GUI thread)
for dealing with the GUI, the windows messages, etc; all actual operations (database,
betwork, calculations) should be delegated to threads.
2. fastest execution
to improve performance: if you want a process to be completed as soon as possible,
then it does not make sense to have system resources (CPU power, bus bandwidth, ...)
less active than they could be, i.e. you want to have maximum chance of code being ready
for execution. Having only one thread to execute all code often is not the right way then.
With this in mind you might consider adding threads to execute identical jobs, each handling
part of the data. For performance reasons this typically does not help beyond a few threads,
since they would compete with each other for system resources (there is only so much a disk
or a network can offer). If the actual bottleneck is CPU power, then I would recommend
not to exceed 2*Environment.ProcessorCount
Final comments:
1.
multi-threading always needs thread synchronization and/or interthread communication;
you can not just have a number of threads working on shared data without protecting the
data from becoming inconsistent; the Thread class, as well as mutexes, locks, and the like
will support this.
2.
the GUI Controls are not thread-safe; Windows requires that a Control only be accessed
by the thread that created it (normally the GUI thread for all of them, since they typically
are all linked in one big hierarchy). When other threads need to report and show some
results using the GUI, there is an Invoke mechanism, supported by Control.InvokeRequired
and the methods Control.Invoke() or BeginInvoke() methods.
3.
threads are either foreground or background; all foreground threads must finish before
your app can exit. As a result it often is best to use background threads for things
that should go on in the background and not prevent an app from exiting.
|
|
|
|
|
Thanks for the great detail and time you took to reply to this.
the one that im interested in looking more into is
The part you wrote here
the GUI Controls are not thread-safe; Windows requires that a Control only be accessed
by the thread that created it (normally the GUI thread for all of them, since they typically
are all linked in one big hierarchy). When other threads need to report and show some
results using the GUI, there is an Invoke mechanism, supported by Control.InvokeRequired
and the methods Control.Invoke() or BeginInvoke() methods.
any quick examples to look at , at all Luc ..
kind regards
Robbo
|
|
|
|
|
vbbeg wrote: any quick examples to look at
Hi,
the world is full of examples, just search InvokeRequired on CP or Google site.
I even have an example in my Sokoban article, see the last code snippet in the article's
text (it is C# code but the mechanism itself is language independent).
|
|
|
|
|
I am using vb.net 1.1 for desktop application.
While displaying contents of a datatable / dataview in a datagrid, I wish to suppress some columns (foreign keys, few admin fields) which user is not concerned with.
how do I do it?
thanks,
Madhav
|
|
|
|
|
If you are using visual basic 2003 then you can use the following statement
I think the styanx for hidding a column is like this.
datatable.columns(0).columnmapping = Hidden
|
|
|
|
|
Hello,
Thanks for indicating the way. Actual code is
tblMaster.Columns("Id").ColumnMapping = MappingType.Hidden
tblMaster.Columns("IsBillable").ColumnMapping = MappingType.Hidden
where "tblMaster" is datatable, it does work and seems to be correct way of doing this.
Now I am trying to see how the hidden columns will be updated when foreign key values change due to change in name/description of foreign key or when a new record is added.
I will post the concerned code when I check it thoroughly.
thanks once again.
thanks,
Madhav
|
|
|
|
|
infotools wrote: While displaying contents of a datatable / dataview in a datagrid, I wish to suppress some columns (foreign keys, few admin fields) which user is not concerned with.
You could build a query and only select the columns that you want to display using that query, before you bind the datatable to the grid, i.e:
SELECT column1, column2, ... FROM [tableName] WHERE ...
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
When the User Logs on, make sure his UserGroup is stored in a session variable i.e.
Session("AccessGroup") = row("vchAccessGroupName")
Then in the OnItemDatabound event for the datagrid:
If Session("AccessGroup") <> "Admin" Then
e.Item.Cells(x).Visible = False //////x being the index of the column in the html
End If
That's all really. Hope this helps.
|
|
|
|
|
Hi, i currently using VB.NET and RichTextBox for coding HTML, but how can i display design, do you have any library, please help me.
Thanks
Socheat
|
|
|
|
|
Do you mean design as in tables and images etc?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein
|
|
|
|
|
Yes, i mean like that
Socheat
|
|
|
|
|
Well, I'm not really sure how to do something like that with a Rich text box. I suppose you could use the web browser control? That way it will be able to display web pages in your application, without the need for loads and loads of code.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein
|
|
|
|
|
Hiya,
I was just wondering if there was a way of stopping a form from loading when the application starts in vb.net, and instead using the code in a seperate vb module?
Thanks, any help will be greatly appreciated,
Lloyd A.
Lloyd J. Atkinson
|
|
|
|
|
I believe your choices of startup are form or sub main. what do you want to happen?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
Well basically I just want the application to start up, run through the code and without needing a form. I've tried many different ways but I just cant figure it out.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein
|
|
|
|
|
Hi,
if you build a "Console App" it gets started from a DOS prompt and will interact inside
the console; if double-clicked it will open its own console.
if you builw a "Windows App" it by default creates and opens a Form, because Visual Studio
includes a "Application.Run(new Form1())" in your main code; if you just use
"Application.Run()" then no form is created/shown.
Hence: choose Windows App, and omit the form.
|
|
|
|