PlausiblyDamp
Administrators-
Posts
7016 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by PlausiblyDamp
-
You only get the privilege of a signature / avatar after 25 posts to these forums. This is just a precaution to prevent wastage of server storage for users who only post 1 or 2 messages and never return but have uploaded an avatar. Once you have managed 25 posts the options will become available - however please do not just post messages just to increase your post count. You may also want to look here for the full list of posting guidelines.
-
FileStreamer = New FileStream(Application.StartupPath & "\" & Filename & "(" & fileSplitNumber.ToString & ").mpg", FileMode.Create) just make sure you've closed the previous file before executing the above line of code.
-
If you put a breakpoint on the 1st line - does it ever get executed?
-
When you say it doesn't work - exactly what do you mean? does it fail to compile? Crash at runtime? Not work as expected? How is rightclick declared? Also in Vb I would recomend agains using variable names that are the same as class names - it can lead to confusion as VB isn't case sensitive.
-
You could be opening the file to write to it rather than read from it.
-
What type of variable is PrimaryFile?
-
Datagrid Editcommand custom controls, and something else...
PlausiblyDamp replied to Rothariger's topic in ASP.NET
you may want to look at some of the links / articles on this site -
if System.IO.Path.GetExtension(filename) = "jpg" then file.copy(ofd.filename,newname+ofd.filename.extension) end if
-
http://www.xtremedotnettalk.com/showthread.php?s=&threadid=73095 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=70566 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=80277
-
You are probably better asking VB6 questions over at our sister site. http://www.xtremedotnettalk.com/forumdisplay.php?f=72
-
Do any of the code in the other classes change the cursor? You may be unsetting it a bit too early in some situations. You may want to look at a recent posting in the Code Library here that may help - just updated it to check if the cursor has been modified in between the class setting it and unsetting it (if that makes sense)
-
VB.Net cannot do operator overloading. The link suggests names to use that could be called from other languages if you are using operator overloading in C#.
-
Could you post the relevant code on how you are setting / un-setting the cursor? Does this problem occur in several places or just in one or two particular locations?
-
Progress Bar - updating a web form whilst processing
PlausiblyDamp replied to hankthetank's topic in ASP.NET
I would try to avoid going with an ActiveX component as a solution, the extra download time may be excessive compared to the functionality gained. Also many users may have ActiveX disabled (either personally or at a company firewall / proxy) for security reasons or run a browser that doesn't support ActiveX. -
The following should give you an idea - proper error handling / naming conventions etc really should be considered though ;) Public Class CDClass 'Public Structure CDClass - would work just as well, doesn't have to be a class Public Class SortPurchaseDate Implements IComparer Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare Dim cd1, cd2 As CDClass cd1 = DirectCast(x, CDClass) cd2 = DirectCast(y, CDClass) Return cd1._PurchaseDate.CompareTo(cd2._PurchaseDate) End Function End Class Public Class SortTitle Implements IComparer Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare Dim cd1, cd2 As CDClass cd1 = DirectCast(x, CDClass) cd2 = DirectCast(y, CDClass) Return cd1._Title.CompareTo(cd2._Title) End Function End Class Public _Title As String Public _PurchaseDate As Date Public _AdditionalInfo As Object Public Shared Function TitleComparer() As IComparer Return DirectCast(New SortTitle, IComparer) End Function Public Shared Function PurchaseComparer() As IComparer Return DirectCast(New SortPurchaseDate, IComparer) End Function End Class to use them code like the following should work Dim cds(3) As CDClass cds(0) = New CDClass cds(0)._Title = "apple" cds(0)._PurchaseDate = Date.Now cds(1) = New CDClass cds(1)._Title = "orange" cds(1)._PurchaseDate = Date.Now.Subtract(TimeSpan.FromHours(3)) cds(2) = New CDClass cds(2)._Title = "banana" cds(2)._PurchaseDate = Date.Now.Subtract(TimeSpan.FromHours(1)) cds(3) = New CDClass cds(3)._Title = "Airplane" cds(3)._PurchaseDate = Date.Now.AddHours(3) Array.Sort(cds, CDClass.PurchaseComparer) Array.Sort(cds, CDClass.TitleComparer)
-
Little class inspired by a code snippet from Nerseus originally posted here this C# class will set the Cursor for a given form and reset it when the class is disposed - propbably best used with C#'s using function. Sample usage //following line will set the mouse pointer to the hourglass using (ChangeMousePointer c = new ChangeMousePointer(this)) { for (int i=0;i < 1000000; i++) Application.DoEvents(); } //cursor will be restored here The class also provides an overloaded constructor allowing you to specify which cursor is required. In a debug build the class runs slower as it will record which Method / File / Line it was allocated on (Using the StackTrace and StackFrame classes) and has a finalizer that checks we have been properly disposed - if not it will assert giving the relevant details about it's creation. In a release build all this information is removed and no Finalizer is emitted. Typical assert output is as follows ---- DEBUG ASSERTION FAILED ---- ---- Assert Short Message ---- ChangeMousePointer not disposed ---- Assert Long Message ---- Originally allocated Method : button2_Click File : c:\documents and settings\x\my documents\visual studio projects\windowsapplication7\form1.cs Line : 117 at ChangeMousePointer.Finalize() The class can be used for VB you just have to remember to call .Dispose manually (VB doesn't have the equivalent of C#'s using) Edit: In debug builds now asserts if the cursor has been changed to a different cursor in between the object being created and disposed. ChangeMousePointer.zip
-
In form2 you don't need the Handles Button1.Click on the following line Protected Overrides Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click The event is already being handled by the base class' Handles statement. Remove the handles clause and things sould now work.
-
You would definately be better of looking more into Joe Mamma's suggestion - using IComparable will result in you having to write much less code. If you prefer a VB version Public Class CDClass 'Public Structure CDClass - would work just as well, doesn't have to be a class Implements IComparable Private _Title As String Private _PurchaseDate As Date Private _AdditionalInfo As Object Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo If TypeOf obj Is CDClass Then Dim c As CDClass c = DirectCast(obj, CDClass) Return _Title.CompareTo(c._Title) Else Throw New ArgumentException("Can only compare to CDClass") End If End Function End Class If you have an array of these called CDs the following code will work Dim CDs() as cdclass 'Set array up how you would normally 'redim the array and add to it etc..... Array.Sort(CDs) 'CDs is now sorted
-
Mid can be replaced with .SubString and InStr with .IndexOf string s = "hello world"; int i = s.IndexOf("w"); //i=6 string s2 = s.Substring(2,4); //s2="llo " However these are not C# functions, they are intrisic to the .Net framework and you should also be using these from VB.Net rather than the legacy VB6 functions.
-
In the page_load event try putting Response.Cache.SetCacheability(HttpCacheability.NoCache) this should prevent the browser from caching that particular page.
-
If you mark a class as MustInherit you can provide functionality - this is the main reason for using an abstract (MustInherit) class over an interface, sub classes gain the base class functionality and can be used anywhere it is expected but the sub classes can also provide additional functionality or override the base classes implementation of a function (providing the base class allows this). If an individual function is marked as MustOverride then you cannot provide any implementation in the MustInherit class - classes that derive from it must provide their own implementation. There is a lot more to deciding between Interfaces / abstract classes than I've covered here and the points mentioned aren't enough to make that decision accurately - a proper design phase with decent analysis would be required for all but the most trivial of scenarios.
-
You could create a form, set the FormBorderStyle property to none. Give the form a non-standard back colour and use the same colour for the form's transparency key. Drop your controls on to the form and it should do what you require.
-
It should be - web.config is case sensitive.
-
Not sure what the problem could be, the version I was hacking around with here works fine - running it just displays MTUer to the console. I've attached my working copy - may be worth doing a diff with your sources to see if anything else has changed. Plugins.zip