Volte
*Experts*-
Posts
2372 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Volte
-
Me will always refer to the class instance you are inside, not the object that is recieving an event. I believe mutant was referring to if you made your own button class: Public Class MyButton : Inherits Button Public Sub ChangeText() Me.Text = "Moooo" End Sub End ClassIf you put that button on your form and called its newly made ChangeText() method, the text of the button would change to "Moooo".
-
You can still use the SendKeys class in a formless project; when you create the project, right click the 'References' item in the Solution Explorer and click Add. Find System.Windows.Forms.dll in the list and add it to the project references list. You can use SendKeys now by using System.Windows.Forms.SendKeys.Send("mooo")Or, at the top of your .vb file (above the Class declaration line) put Imports System.Windows.FormsThen you'll be able to access the SendKeys class like this: SendKeys.Send("moo")
-
The reason you can't do Form1.Location is because all Forms in .NET are classes; you can't change the location of a class, obviously, only of an instance of the class. You could do this: Dim frm As New Form1() 'create a new instance of the Form1 class frm.Location = New Point(10, 20) 'move the form frm.Show() 'show the formand it would work. As mutant said, Me refers to the *instance* of the class that you are currently working in.
-
Sends an notice to the moderators that a post is inappropriate for one reason or another. It generally should only be used when it is really necessary, because I believe it sends the notice by e-mail.
-
Due to C#'s "freestyle" nature, code that is written in C# can generally look much nicer than code written in VB.NET. However, on the other extreme, it can also look horrendous, moreso than VB.NET. :p You just need to put time into it. And generally you wouldn't bother converting the code. You can mix different kinds of projects into one solution; you could make DLLs in C# and use them in VB.NET. This is useful because C# and VB.NET do have some slight differences; for example, C# supports operator overloading and unsafe code blocks (allows you to use pointers within C# code, C++ style), while VB.NET has more ease of use when working with events, among other things. The diversity in the .NET languages can come in handy, not only in terms of functionality, but people coming from just about any previous languages can feel at home; people who are used to C-style syntax will feel comfortable with C#, people who are used to the BASIC style of syntax will be more comfortable with VB.NET. However, I recommend starting with C# if you are just beginning. For whatever reason, VB.NET provides a set of VB6 compatability functions that work like the previous ones in VB6. For example, you can use Mid(string, 2, 4) like you could in VB6, but the "good" way to do it is string.Substring(2, 4). The Mid function is part of the Microsoft.VisualBasic namespace, which is provided mostly for backwards compatability and should generally be avoided. This can be very confusing to newbies, and cause them to develop bad coding habits if they get into the habit of using the old familiar VB6 methods. Thankfully, C# does not provide these compatability functions, and so it forces you to get used to developing .NET Framework compliant code. And yeah go ahead and send that stuff to your boss. :)
-
Select Case True Case m Like "200*" 'code Case m Like "test*" 'code End SelectThat's really the only way to do it. Not much different than the If block really.
-
It's fully object oriented, like C++. All data types are classes (even String and Integer and the like), giving you much more control over how they are used. .NET assemblies (DLLs in this case) do not require registration with regsvr32, eliminating the concept of "DLL Hell" that was almost unavoidable when using many COM DLLs. .NET assemblies simply need to be included with your application for them to be used. It comes with a wide variety of objects that VB6 did not have. Regular expressions, GDI+ (graphics library), ADO.NET, XML readers, full Socket implementations, printing functionality and support for streams (which can be used for sending and receiving data over networks, to hard drives, through memory, etc) are just a few examples. The .NET framework is, in theory, cross platform. If you write a fully .NET Framework compliant program (i.e. without Win32 API or unmanaged code), then it should, with minimal changes, compile on another implementation of the .NET framework for another operating system. This may not apply to you right now, but it's still good to know that if you need to move away from Windows, your code doesn't become totally useless. Just some examples. :)
-
New User Profile Field: .NET Framework Version
Volte replied to Derek Stone's topic in Suggestions, Bugs, and Comments
I like the idea of this user profile field, and doing it though vB3 is coming soon is no big deal. Profile fields are part of the database, and so no code hack is required; they will even be imported into vB3 during the upgrade process. Also, that's great news Bob. :) Good luck... -
You should look at the ListView control (read about it in the MSDN). It supports multiple columns, like the file explorer pane in My Computer, when you're in Detail View.
-
Finding and Replacing Text within a file
Volte replied to georg's topic in Directory / File IO / Registry
Standard edition don't have these things by default. Look here. -
Dim b As Byte = Convert.ToByte(New Random().Next(0, 25)) TextBox1.AppendText(Convert.ToChar(b + 97))
-
Is this program being started from a Sub Main() (using Application.Run) or is it just a standard startup form?
-
Same way you do all that other stuff... just append it withmailMessage.Body &= "<br><br>______<br>Signature!"or something.
-
No, although if you have some free time on your hands you can go pick the ones you would like, and click the 'Show Printable Version' link at the bottom of each one. Then you just save the page's source to your hard drive.
-
Dotfuscator just alters your variable and sub names and makes your code as confusing as possible so any decompiled code would be next to worthless to anyone who wasn't serious about retrieving the code. Hardcoding the password in the app won't do much good and someone with a hex editor could get it out if they want. Not only that, but they could capture the data being sent out of the program with some sort of packet sniffer and possibly get the password from that (if it's not 128-bit encrypted or something). Do you have any administrative rights to this FTP? If you do, you could simply set up an 'incoming' directory that people have access to upload to and don't give them any upload rights to any of the other directories. That way you could give the username and password to the users without worrying about them messing up anything else.
-
What kind of stuff is in the order details? You could do something like this (just an example, of course): mailMessage.Body &= "<table width=""100%"">" & Environment.Newline For i = 0 to OrderDetails.Count - 1 Dim od As OrderDetail = OrderDetails(i) mailMessage.Body &= "<tr><td>" & od.StartDate & "</td><td>" & od.EndDate & "</td></tr>" & Environment.Newline Next i mailMessage.Body &= "</table>"That would simply create a two column table that contains a start date and an end date, with one row for each item in the 'OrderDetails' collection. You will of course need to modify it to fit your own needs and data format.
-
Adding pictures to richtext boxes
Volte replied to wardrobeandrew's topic in Graphics and Multimedia
There is an article (For VB6, but same basic idea) on EliteVB written by Garrett Sever on how to properly insert pictures into RTBs. -
You might want to look in the Tutors Corner for divil's Plugin Based Application tutorial, as well as an accompanying sample that supports a UI included in the plugin. You could put each section of the app in a plugin. I'm not sure how practical this would be with your app, but it's worth investigation. Take a look at those two links. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=49597 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=70920
-
You could either 1) Open the file (with the StreamReader) and use the StreamReader's ReadToEnd() method to put it into a String. Then use the String's IndexOf() function to find the substring. or 2) Open the file (StreamReader again) and read each line individually, using the StreamReader.ReadLine() method inside a loop. When you read in one line, search the one line for the substring (using IndexOf, as in the first point). If it's there, you can stop the loop; if it's not, you keep looping. If you get to the end of the file, then you know the substring is not part of the file.
-
Look here: http://dbforums.com/arch/71/2003/6/803698
-
Glad I could help. :) Oh and my name is VolteFace thankyouverymuch ;) (honest mistake, I know). :)
-
Do you experience any performance problems? You really shouldn't rely on the CPU usage gauge for looking for problems. Even a loop as simple as this:Do Application.DoEvents LoopWill send the CPU usage flying.
-
A good way to conserv space (is with regions):#Region " Variables " Dim blah As Blah ' ... ' ... ' ... #End RegionThen you can simple expand and contract the region. :)