|
hi all
i am downloading multiple file . Each file is download on seperate thread. how can i determine that all downloading is complete or not.
any help will be greatly appreciated
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
How are you downloading them ? Can't you just check if any thread is still running ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hello sir.
i simply write a class which code is below
Imports system<br />
Imports System.Threading<br />
Imports System.IO<br />
<br />
Public Class DownloadClass<br />
Public DownloadFileWithSourcePath As String<br />
Public DownloadFileWithDestinationPath As String<br />
<br />
Public Event DownloadComplete()<br />
<br />
Sub StartDownload()<br />
If Not File.Exists(DownloadFileWithDestinationPath) Then<br />
Try<br />
My.Computer.Network.DownloadFile(DownloadFileWithSourcePath, DownloadFileWithDestinationPath)<br />
<br />
Catch ex As Exception<br />
<br />
End Try<br />
<br />
End If<br />
' RaiseEvent DownloadComplete()<br />
End Sub<br />
<br />
<br />
End Class
i use above code in following procedure
Protected Sub DownloadFileInfo(ByVal sourcePath As String, ByVal DestinationPath As String)<br />
If Not File.Exists(DestinationPath) Then<br />
Dim DownLoadObject As DownloadClass = New DownloadClass<br />
Dim DownloadThread As New System.Threading.Thread(AddressOf DownLoadObject.StartDownload)<br />
DownLoadObject.DownloadFileWithSourcePath = sourcePath<br />
DownLoadObject.DownloadFileWithDestinationPath = DestinationPath<br />
'DownloadThread.IsBackground = True<br />
DownloadThread.Start()<br />
<br />
'MsgBox(DownloadThread.ManagedThreadId)<br />
End If<br />
End Sub
above procedure is called multiple time during processing.
So now the base of above coding, can i get know that downloading of all thread is complete or not?
if not can you provide me some idea or code or some links which help me
thanks
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
i have a datatable representing items in an order as follows
Items:
itemNum
Origin
Destination
QtyOrdered
AmountPackaged
I have a datagrid that i only want to show only the items that haven't been fully packaged i.e. QtyOrdered isn't the same as AmountPackaged. So i set its datasource to the tables default view and set items.defaultview.rowfilter = "QtyOrdered <> AmountPackaged"
However this doesn't seem to do anything as when AmountPackaged matches QtyOrdered the row never gets filtered out. any idea on why my filter isn't working?
|
|
|
|
|
Hi all. I am trying to save an image which i am creating in code. Everytime i call the Bitmap.Save Function i get an error "A generic problem occurred in GDI+". I have googled this for the past hour and have been unsuccessful. Her is the source code you need to understand what i am doing.
Dim bmp As New Bitmap(80, 80)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim LinesPen As New Pen(Color.Black, 2)
LinesPen.Alignment = Drawing2D.PenAlignment.Center
g.DrawRectangle(LinesPen, 1, 1, 78, 78)
g.DrawLine(LinesPen, 27, 1, 27, 79)
g.DrawLine(LinesPen, 53, 1, 53, 79)
g.DrawLine(LinesPen, 1, 27, 79, 27)
g.DrawLine(LinesPen, 1, 53, 79, 53)
Try
'----------------ERROR HERE------------------
bmp.Save(Me.DestinationLabel.Text, System.Drawing.Imaging.ImageFormat.Png)
'-------^^^^-----ERROR HERE-------^^^^-------
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Please help if you can or if you have also experienced this.
|
|
|
|
|
Hi,
Most, if not all, errors inside GDI+ are reported as "generic problem occurred in GDI+".
If the affected line is an Image.Save chances are your path is incorrect or inaccessible,
your disk is full, or your destination file exists and is locked.
if you load an image from a file, most of the time the file remains locked as long as
the Image is alive. This would prevent you from saving an image to the same path.
It applies to Image.FromFile, and probably also to PictureBox.ImageLocation
The one exception I am aware of is when you use Image.FromStream
An alternative work-around is to work with a copy of the image:
load the image with Image.FromFile,
create a new image from it with new Bitmap(Image),
dispose of the original image.
|
|
|
|
|
I am not using FromFile. The image does not exist and is not overwriting another image. It is a completely new image which i have drawn the graphics from then added graphics objects (rectangles and lines) to, i still recive the same error. I just can't save it for some reason. I have no idea why. I have tried making a second image of the same size and making it equal the first one then saving the second one and i still have problems.
|
|
|
|
|
OK, some questions then:
1. is your path correct?
2. do all the (sub)directories exist?
3. is the path refering to an existing file?
4. if so, did that file get created very recently? explain!
|
|
|
|
|
Problem Solved, there was a slight error in the way i dealt with the filename.
|
|
|
|
|
If you load the image using FromFile, the file is locked for the entire liftime of the image object. This means you cannot save it back to the original file because of the lock.
Instead, use the FromStream method to load the image. When you close your FileStream object, the lock is released, then you can save the image back to the original file.
|
|
|
|
|
You're obviously right, but I recently found a case where if I used a stream, and then draw the image onto a new bitmap, it was drawn at 1/4 size. I don't know why this was happening, but it was a repeatable bug across many ( users ) machines.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: if I used a stream, and then draw the image onto a new bitmap, it was drawn at 1/4 size. I don't know why this was happening, but it was a repeatable bug across many ( users ) machines.
That's whacked. I haven't seen it happen myself, ...yet. Hmmm. Any clues on the image format that it was using? TIFF, BMP, JPEG, all of the above? Dimensions, color depth, pixel format, compression?
|
|
|
|
|
They were JPEGs, they were a fair size, and they were 24 bit.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
I am working with tab control in a MDI form. In one of my tab page, I’ve a split container control. Now I want to load another form in the panel2 of split container. Using “mytab_enter” event, I am loading all the controls of that Form into the panel container.
Dim objFrm1 As Form2
objFrm1 = New Form2()
objFrm1.TopLevel = False
SplitContainer2.Panel2.Controls.Add(objFrm1)
objFrm1.Show()
the form is getting loaded without any controls being displayed. A blank form.
In this the fact what I observed is. If I add controls to 1st tab page all the controls will get loaded without any problem. I face this problem with subsequent tabs.
Can any body please help me out in this problem?
Thank you,
Regards, Krishnaraj
|
|
|
|
|
Can You Please Help Me How To Set A Background Image To Mschart In VisualBasic 6.0
Manoj
|
|
|
|
|
AFAIK, there is no BackgroundImage property in the MsChart control. You'd have to either use a different control that exposes this functionality, or write your won.
|
|
|
|
|
hi
i have created a small application in vb.net .if we minimise the application and restore it we are able to see the restoration of controls one by one but not because of system speed. i found the difference when comparing my application with another utility developed in dotnet. comparitively my application is not much big but why it happens.in all the small small application developed by me and my friends i am able to see the same scenario. could any one tell why it looks very slow.and how to make the application much professional.
with regards
Balagurunathan.B
|
|
|
|
|
It's hard to say since we are not able to see the code what you wrote in your application.. The problem might occurs for so many reason..
1. If you are using too much of drawing things (making funcy colors or custom draw or etc) it might make your application slow..
2. Did you use so many third-party controls in your app?
3. You should use DoEvent in some cases.
4. Did you load something in Windows Paint event or show event? If you want to load something, you should use the different thread for that so it won't freeze your UI..
|
|
|
|
|
no
i am not using too many third party controls and all
application is not slow
when we are minimising the form it gets minimised in fraction but while restoring it we are able to see the things likke form loads,panel and cotrols. there is no spl code i am using . if its in form load event ok but on every restore after minimising the application it looks slow comparitively to application developed by professionals. the sam thing happens for all my friends application also .
i am not asking any behaviour while loading the application or control. my doubt is while retoring the application after minimising i application should restore in fraction.
with regards
Balagurunathan.B
|
|
|
|
|
hi all
i want to determine the location of current cell of datagridview. in datagridview visiblity of some column is false and display index is also changed.
anyone have some idea ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
I think that there is one property called CurrentCell in that DataGridView. And you can get the rownumber and column number of currentcell.
|
|
|
|
|
thanks for reply
i think you does not understand my problem properly. Actually i want to Get the Left & top position of current cell.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Hello guys I've been trying to validate a textbox with user control and it seems like my text property i coded is wrong because if i show the content of the textbox like msgbox(textnox1.text) the msgbox is empty. this would be my design code:
<br />
<br />
<global.microsoft.visualbasic.compilerservices.designergenerated()> _<br />
Partial Class prodidtextbox<br />
Inherits System.Windows.Forms.UserControl<br />
<br />
'UserControl overrides dispose to clean up the component list.<br />
<system.diagnostics.debuggernonusercode()> _<br />
Protected Overrides Sub Dispose(ByVal disposing As Boolean)<br />
If disposing AndAlso components IsNot Nothing Then<br />
components.Dispose()<br />
End If<br />
MyBase.Dispose(disposing)<br />
End Sub<br />
<br />
'Required by the Windows Form Designer<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
'It can be modified using the Windows Form Designer. <br />
'Do not modify it using the code editor.<br />
<system.diagnostics.debuggerstepthrough()> _<br />
Private Sub InitializeComponent()<br />
Me.textbox1 = New System.Windows.Forms.TextBox<br />
Me.SuspendLayout()<br />
'<br />
'textbox1<br />
'<br />
Me.textbox1.Location = New System.Drawing.Point(0, 0)<br />
Me.textbox1.Name = "textbox1"<br />
Me.textbox1.Size = New System.Drawing.Size(100, 20)<br />
Me.textbox1.TabIndex = 0<br />
'<br />
'prodidtextbox<br />
'<br />
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)<br />
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font<br />
Me.Controls.Add(Me.textbox1)<br />
Me.Name = "prodidtextbox"<br />
Me.Size = New System.Drawing.Size(100, 20)<br />
Me.ResumeLayout(False)<br />
Me.PerformLayout()<br />
<br />
End Sub<br />
Friend WithEvents textbox1 As System.Windows.Forms.TextBox<br />
<br />
End Class<br />
<br />
</system.diagnostics.debuggerstepthrough()></system.diagnostics.debuggernonusercode()></global.microsoft.visualbasic.compilerservices.designergenerated()>
and this is my textbox property codes:
<br />
public class proidtexbox<br />
dim t as object<br />
public overrides property text() as string<br />
get<br />
return t<br />
end get<br />
set(byval value as string)<br />
t=value<br />
end set<br />
end property<br />
end class<br />
please i need this to finish a class project that i should submit tomorrow
thanks for you all reading this
eager to learn
|
|
|
|
|
highjo wrote: dim t as object
public overrides property text() as string
get
return t
end get
set(byval value as string)
t=value
end set
end property
If I understand your question correctly, you want to return the string that is typed in text1, right? if yes, you can try like that..
<br />
public overrides property Text() as string<br />
get<br />
return textbox1.Text<br />
end get<br />
set(byval value as string)<br />
textbox1.Text =value<br />
end set<br />
end property<br />
|
|
|
|
|
Yeah! i think this should work thank you man.Didn't it is that obviuos thank you
eager to learn
|
|
|
|