|
Yes i am actually running the hitting of database and it's bizness logic on a separate thread.
I heard that i can actually use something like DoEvent on something then to ensure that the screen will still maintain at it's status as before while loading the new data in the datagrid... any idea as to how to use the DoEvent thing...?
~MicDevNet~
|
|
|
|
|
Application.DoEvents()
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Yeah... it's working already.. thanx.. wow.. just a simple line of code and the flicking actually goes away.. hahahah.. thanx very much...
~MicDevNet~
|
|
|
|
|
I have an Access Database to read from.
this is query15:
SELECT TempData.ID, TempData.TemplateID, TempData.Images
FROM TempData
WHERE (((TempData.Size)="15x15"));
It is filling an imagelist with image names from the database. The currently working code is as follows:
Dim ImageList1 As New ImageList()
Dim Count As Integer
Dim Path As String
Temp15Adapter.Fill(TempDS151)
ImageList1.Images.Clear()
Aspect = "15x15\"
If Aspect = "" Then MsgBox("oops", MsgBoxStyle.Information)
For Count = 1 To TempDS151.Query15.Count
Path = TempDS151.Query15(Count - 1).TemplateID
ImageList1.Images.Add(Image.FromFile("C:\Adobe Project\Icons\" & Aspect & Path & ".jpg"))
Next Count
For Count = 1 To TempDS151.Query15.Count
Path = TempDS151.Query15(Count - 1).TemplateID
ListView1.Items.Add(Path)
Next Count
ListView1.LargeImageList = ImageList1
For Count = 0 To TempDS151.Query15.Count - 1
ListView1.Items(Count).ImageIndex = Count
Next Count
ListView1.View = View.LargeIcon
ListView1.Update()
Me.Update()
What I need to do now is filter the queries on TempData.Images depending on a listbox choice (1..12). I would hate to make 12 queries because I will also have to make a similar change to the TempDS151 dataset (for other than 15x15). This is my first adventure with database useage, so I am doing thing 1 step at a time. My initial question may hold up, or I may be shortsighted on my question. Anyone have some help as to which route to travel? I labored a few days just to get THIS to work, so any confusing suggestions will need some kind of example or at least written "For Dummies"
Thanks in advance...
Let me know if I am missing any pertinant info.
David M. LevineX|
|
|
|
|
|
Would your code be simpler like this:
Dim newListViewItem As ListViewItem
For Count = 0 To TempDS151.Query15.Count - 1
Path = TempDS151.Query15(Count).TemplateID
ImageList1.Images.Add(Image.FromFile("C:\Adobe Project\Icons\" & Aspect & Path & ".jpg"))
newListViewItem = ListView1.Items.Add(Path)
newListViewItem.ImageIndex = Count
Next Count
ListView1.LargeImageList = ImageList1
ListView1.View = View.LargeIcon
ListView1.Update()
Me.Update()
What are you trying to do? I can't seem to get my brain around what your doing and what your database is for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Simpler version is true.
The database contains a list of Template IDs and the number of photographs in that template. The thumbnails of the template show in the list box along with thier IDs. I need to be able to change the contents of the listbox depending on which aspect ratio the album is (15x15 vs 11x14) and how many photos they need to place. The reason for using a database is so I can add templates at will without rewriting the code.
|
|
|
|
|
The process cannot access the file "\\cvspwcora010\d$\oracle\Admin\log\oramon_marsprod.log" because it is being used by another process.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.IOException: The process cannot access the file "\\cvspwcora010\d$\oracle\Admin\log\oramon_marsprod.log" because it is being used by another process.
Source Error:
Line 27: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 28: Dim myFileReader As System.IO.StreamReader
Line 29: myFileReader = System.IO.File.OpenText("\\cvspwcora010\d$\oracle\Admin\log\oramon_marsprod.log")
Line 30: Dim myString As String
Line 31: myString = myFileReader.ReadToEnd
hi.. any idea why this happens? thanks
|
|
|
|
|
Yeah, you're trying to open a text file that is already open by another process. It's possible that this has been caused by a rogue process from a previous debug attempt - happens to me from time to time, and I close the project and reopen, in VS. Not that I go around writing to text files in my web apps, of course.....
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
yeah.. but how can i possibly access the file? a separate process is also accessing the text file
|
|
|
|
|
Then you're screwed. It just doesn't work. I dunno if you can open it if you specify read only access, but I don't think so.
It may be possible under Linux.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
oh i see.. thanks for the help anyway...
regards,
leny
|
|
|
|
|
Sounds like a stupid question...but i seriously cannot figure it out. i am new at VB.NET and i know a bit of C++, but i am having a hard time with VB because it is so different (i still havent grasped the concept of object-oriented programming).
|
|
|
|
|
Hello,
To close your application using code, all that you need to do is use:
Me.Close()
Or:
End
However, Me.Close() is better because it allows the application to finish "garbage collecting".
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
thanks. i was going a little crazy trying to figure it out. say--would you know how to set the desktop picture given a filename?
|
|
|
|
|
does anybody know how i can create a variable?
I mean the VB version of doing this in C++:
int arrayname[length]
and
does anybody know how i can have the user open a picture file and change the desktop picture?
|
|
|
|
|
The VB version is:
Dim arrayname(length) as integer
and
you have to be more specific with that
|
|
|
|
|
You're coming to VB from C++, and the main problem is you don't understand OO ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You can use the method (Application.Exit()):
type
System.Windows.Forms.Application.Exit()
or
Application.Exit()):
which is the same.
|
|
|
|
|
Hello,
I have been working on an application, however, I am unable to stop my application until Windows Media Player starts playing a file. Here's my code:
(As a side note, the variable "i" is an integer, and the LSTFiles is a listbox that contains a list to a number of files)
For i = 0 To LSTFiles.Items.Count - 1
If LSTFiles.Items.Item(i) <> wmp1.URL Then wmp1.URL = LSTFiles.Items.Item(i)
If isReady = True Then
Dim newentry As String
newentry = newline + DTPDate.Value + vbTab + vbTab + wmp1.currentMedia.duration.ToString + vbTab + ComboBox1.Text + vbTab + ComboBox2.Text
isReady = False
completelog += newentry
Else
i = i - 1
End If
Next
isReady is a boolean variable that is in the declarations part of my form. My event handler that changes isReady is:
Private Sub wmp1_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles wmp1.PlayStateChange
If wmp1.playState = WMPLib.WMPPlayState.wmppsPlaying Then isReady = True
End Sub
My For Loop should keep on repeating until the isReady = True and then record the data to the currentlog (a string). However, the loop seems to keep on going forever, and eventually I have to press the stop button on the VB .Net IDE.
Can anyone please help me?
Thanks,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
Have you used the break points to see what's going on?
|
|
|
|
|
Hello,
It seems to get stuck on the loop when I keep on telling it to i = i - 1 . (I think the loop keeps on going, and my event handler isn't ever triggered due to my loop pausing/stopping my application)
Is it possible to find a different way to pause the loop until the PlayState changes?
Thanks,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
You can use a thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Something as Threading.Thread
Something= New Threading.Thread (Addressof Myfunction)
Something.Start
End Sub
Private Sub MyFunction ()
'Put here your For / Next
'And you can pause the thread by doing something like this
Something.sleep(5000)
End Sub
|
|
|
|
|
Thank you for the help, it works great now!
Thanks,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
Hey everyone ~
This is my first post here and I hope someone can help me. I am trying to call my application that is already running in the system tray with a shortcut when it does not have the focus. I've thought about using a keyboard listener but there has to be a different and easier way to do this. Maybe it could be done by using a desktop shortcut to load another copy of the program but check to see if its already running and give that application the focus. If that makes any sense.
Another question that has nothing to do with the first one is how do you maximize your application if your have a dual monitor setup. There is a built in button that gets applied to your form if you have an ATI video card but I have no idea on how to call that if thats possible at all. But that then leaves everyone else out of luck that doesn't have that card.
If anyone can help me i would greatly appreciate it. Thanks in advance.
FuzMan ~
|
|
|
|
|
Sorry Everyone ~
Forgot to tell you I am using VB.NET 2003. With the newest Framework installed. Thanks again.
FuzMan ~
|
|
|
|