|
Hi there. Use the System.Console object -
dim s as string
Console.WriteLine("Enter your name:")
s = Console.ReadLine()
|
|
|
|
|
In the property browser for a multi line textbox the lines property says: String[] Array and can't be edited in place, one has to use the editor. How do I do that for my classes which can be edited in a property browser so that it just says something which can't be changed and the user has to use the provided editor?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hi,
Here's my problem. I want to open a form then check to see if there are any records present in the Access database that i'm connected to. If there are no records I want the form to close. I keep getting something like can't close the form while creating handle. To get over this I used the mouseMove event so that the correct code would be called after the form has loaded. This works but it's not ideal. Has anyone got any better suggestions as to how I do this.
Thanks in advance
|
|
|
|
|
I'm not sure where you're trying to close your form that's causing you to get this error, but the Form class has a HandleCreated event that you can handle and close if needed.
The ideal solution, however, would be to separate your application logic from your UI and show your form only after you've determined it's appropriate.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I have a class that I want everything in it to ne shared, can events be shared? It allows me to write:
public shared event DoSomething()
but how do I subscribe to those events in my code? WithEvents gives an error.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
WithEvents wouldn't make any sense here because you're not subscribing to an instance event, but rather an event of the class itself.
Use an AddHandler statement to add an event handler for a shared event.
' Note that you're subscribing to an event of MyClass itself,
' not an instance of MyClass
AddHandler MyClass.EventName, AddressOf NameOfMethod
Charlie
if(!curlies){ return; }
|
|
|
|
|
Thanks for that, I wasn't thinking straight
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Im trying to access a Public Property in a form with name Principal(mdiParent) from another one (mdiChild) but i can't get acess whats wrong ?
Private _IDTechLOG As Integer
Public Property IDTechLOG() As Integer
Get
Return _IDTechLOG
End Get
Set(ByVal LeID As Integer)
_IDTechLOG = LeID
End Set
End Property
|
|
|
|
|
XGaMeS wrote:
i can't get acess
What does this mean?
Are you casting the parent form to the correct type? Post the code that's not working to get a more specific answer.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I wasn't seeing the property, and yes it was c casting error
I am a newbie
|
|
|
|
|
Is it possible for a VBScript (i.e. test.vbs) to actually know it is called "test.vbs"?
I seem to recall something in VB Using "Application" "object" for finding out that kind of stuff.
~Mike Stanbrook
modified on Saturday, January 22, 2011 10:21 AM
|
|
|
|
|
WScript.Echo WScript.ScriptName
RageInTheMachine9532
|
|
|
|
|
|
Adding a related question to this thread:
Assuming you don't know it (all or at all) after importing VBScript code, or instantiating a COM object, is there any way to get a list of methods (and perhaps properties) of a VBScript class and/or COM object (built from C/C++ or Visual Basic)?
Basically something like .NET reflection for VBScript/COM.
"A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible." - Freeman Dyson
|
|
|
|
|
Hi everybody.. how can I search a string without caring about the case\
eg..
<br />
Dim str as String = "he HE hE He" <br />
Dim r as Integer<br />
Dim c as Integer<br />
while(r<>-1)<br />
r=str.IndexOf("he",r)<br />
If (r<>-1) Then<br />
r+=2 'adding 2 (he has two letters) so it will start looking at position it first found +2<br />
c+=1<br />
End If<br />
End While<br />
Instead of c=4, I'm only getting c=1
How to search a string in case insensitive?
|
|
|
|
|
r = str.ToLower().IndexOf("he", r)
Charlie
if(!curlies){ return; }
|
|
|
|
|
I'm having issues writing text to a tiff file. However I have no problems saving text to a Bitmap.
Here is an example of the code that works with Bitmap:
Dim objBitmap As New Bitmap(600, 600)<br />
Dim objTextBrush As New TextureBrush(objBitmap)<br />
Dim objFont As New Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel, 0)<br />
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)<br />
<br />
objGraphics.DrawString("Test Text", objFont, Brushes.Black, 0, 0)<br />
objBitmap.Save("test.bmp")
This code works great! But I need to a way to write to tiff.
The code below should work but fails. It returns a black tiff image:
Dim objBitmap As New Bitmap(600, 600)<br />
Dim objTextBrush As New TextureBrush(objBitmap)<br />
Dim objFont As New Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel, 0)<br />
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)<br />
<br />
objGraphics.DrawString("Test Text", objFont, Brushes.Black, 0, 0)<br />
objBitmap.Save("test.tiff", ImageFormat.Tiff)
Any help would be greatly appreciated. In return what I would like to do is build a C# class that will save text to an image in different formats and make it available for free. I have tried tools like CoolWatermark, but it has the same issue.
Ryan
ryan@edevers.com
|
|
|
|
|
hello,
this link - there is a nice example of line charting , but the code is in c#. I attempted to convert it to vb.net but have some issues.
does anyone have vb.net code sample of line charting - specifically, plotting multiple lines?
http://www.codeproject.com/aspnet/LineGraph.asp
or ifyou email me directly I can share what I have so far, maybe someone can get this to work for me. thanks
(bsharris@optonline.net)
bev
|
|
|
|
|
I know this is a toughie, but I figured I'd ask...
I am writing an internal application for my company. We have thousands of Articles on our web server in HTML (actually ASP) format. These articles are technical in nature, and support the various software programs we write. This tool is meant to scan the text of those articles, and convert the information into a new format that we'll be storing in a database.
Part of that conversion process will include identifying the product and version that each article is associated with. This is really easy when the product name is spelled correctly and formatted the same as what I'd expect it to be. Unfortunately, people make mistakes (lots and lots of mistakes) and what I expect is rarely what is there. For a silly example, let's say that I'm scanning the text for the word "Microsoft" to see if this article is associated with a Microsoft product. Easy enough, right?
But as I start looking at articles, I see:
Micro Soft
Microssoft
Microsoff
MS
Microsucks
MSoft
..
..
Well, you get the idea. Doing a simple InStr(Article, "Microsoft") doesn't always find what I want. What I need is a more "fuzzy" compare method. Microsoft SQL Server has a function called LIKE that is kind of close to this - better yet, I can use the FreeText or Contains methods to provide a fuzzy search.
Is there a similar function or technique in VB that would allow me to do a compare like this?
-Todd Davis (toddhd@hotmail.com)
|
|
|
|
|
Not unless you write it.
I found a couple of resources on the 'Net about the subject just by searching for 'fuzzy string compare'.
You might want to try converting this[^] Delphi source. You also might want to try working something up using Regular Expressions. I don't have any code, but it's an idea I would look into.
RageInTheMachine9532
|
|
|
|
|
|
Try doing a SOUNDEX search - when people spell incorrectly, the word usually sounds the same - SOUNDEX creates a numeric value for a string based in its phonetics, so Smithe and Smythe would result in the same SOUNDEX value - believe SQL Server (and definately Oracle - ner!) support it straight out of the box...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hello,
Does any one know how to make or where to get information on a menu like the properties menu in VS.net. I want to add the functionally to my program, on how it hides in tell you hover your mouse over the icon that is off to the right side and then it shows it self.
I hope that made sense
Dale Burmeister
|
|
|
|
|
Does clicking on the close button in the control box on a form raise an event? I would like the code I have for exiting using a menu to be executed if the close on the control box is clicked. Any ideas?
|
|
|
|
|
well you can handle this in queryunload event. It gives you an idea from where the unload event has been called.
I think rest is upto your logic. You can call the menu's click function. Or the better way is to create a common function and call it from different events.
Hope that is what you are looking for.
Ritesh.
|
|
|
|