|
<br />
Convert.ToDouble(yourTextBox.Text);<br />
Remember to catch exceptions as this function will throw one if it the text cannot be converted.
|
|
|
|
|
Try this:
Dim d As Double = Double.Parse(txtFromDate.Text)
The function Double.TryParse() also may be usefull.
----------------------------------------------------------------------
T Manjaly
My C# Tutorials articles www.dotnetspider.com
|
|
|
|
|
Hi, I found the sample of vb6 and mschart control from here.[^] I want to know, is it possible if I use this mschart control in VB.Net application????
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Yes you can (like any other COM control. Open up a form, right click into your toolbox, select add/remove items, click the COM tab, search for 'Microsoft Chart Control...', check it and click ok. Now you can drag drop it like any .Net control onto your form.
Depening on what you are trying to do you should search for some .Net charting controls. The MS charting control is not really bad but has many slight flaws and also some stranges issues. Some chart controls for .Net are freely available here on CodeProject.
|
|
|
|
|
Robert Rohde wrote:
Yes you can
Ok, thank you very much for your information. I will try to do in VB.NET.
Robert Rohde wrote:
The MS charting control is not really bad but has many slight flaws and also some stranges issues
That is the main point that I always consider when I try to use COM object in VB.NET. So is it possible to do some basic task in VB.NET??? And can you tell me what is the main issue???
Robert Rohde wrote:
Some chart controls for .Net are freely available here on CodeProject.
If it is possible, please give the URL to me. I try to find most .Net chart control but it is available only in ASP.NET application. I want to use .Net chart control in windows form but it is not possible to find it. I will try to find myself too and let you know.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Sure it is usable and depending on what you want to do it can be a very good control. The main reason not to use it (for me) was that some (very special) behaviour could not be altered.
A good chart control on CodeProject can be found at:
http://www.codeproject.com/csharp/ZedGraph.asp
If you look fpr something really professional (which also costs a bit) take a look at Dundas Charts:
http://www.dundas.com
|
|
|
|
|
Thank you very much for your information. I already check some part of this article and found that the code is written in VC.Net. Is it possible to write it in VB.NET??? If possible then I might use this control instead of Mschart.ocx control.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
This isn't related to VB but to this forum. How do I post code in the forums where it retains the format. The <code></code> tags don't seem to do what I expect them to do.
|
|
|
|
|
OICU812 wrote:
How do I post code in the forums where it retains the format. The <code></code> tags don't seem to do what I expect them to do.
Use the the pre tag instead [<pre>many lines of code</pre>]. It then will look like this:
public void Foo()
{
}
Best regards
Dennis
|
|
|
|
|
Thanks! Makes a big difference.
|
|
|
|
|
Could someone please lend some assistance to an issue which I expect is simple but eludes me at the moment. The following description is a simplification of what I am trying to do.
I have a collection called PartsCollection which has an Area property which is the sum of the area properties of each object in the collection.
Each object is called PartObject and has Width, Height and Area properties. When width or height is changed the area is recalculated.
I wish to have the PartsCollection.Area property update when either PartObject.Width or PartObject.Height is changed for any object within the collection.
I was thinking of PartObject raising a Changed event and having an event handler for this event in the PartsCollection class. I can't figure out how to wire the handler to all of the objects in the collection.
I trust this description is not too cryptic.
Cheers, in advance
Tim
|
|
|
|
|
Your are looking for the AddHandler and RemoveHandler keywords. They are used to bind and unbind eventhandlers dynamically:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmAddHandlerStatement.asp
With it you can attach events when an item gets added to your collection. But dont forget to remove your eventhandlers when an item is removed (eg. with Remove, RemovAt, Clear...)
|
|
|
|
|
I've been working on a similar problem and I handled it with Delegates. I made an example using your class descriptions to test my knowledge of delegates. I'm no expert here but this will do what I think you are looking for.
'The delegate that handles the communications between classes.
Public Delegate Sub AreaChangedHandler(ByVal sender As PartObject)
Public Class PartsCollection
'simplified collection
'not intended to demonstrate a true collection class
Dim m_collection As New ArrayList
Dim m_Area As Double
Shared Event AreaChanged As AreaChangedHandler
Public Event PartAdded(ByVal part As PartObject)
ReadOnly Property Area() As Double
Get
Dim obj As PartObject
Dim totalArea As Single
For Each obj In m_collection
totalArea += obj.Area
Next
Return totalArea
End Get
End Property
Friend Sub Add(ByVal part As PartObject)
m_collection.Add(part)
RaiseEvent PartAdded(part)
End Sub
Shared Sub OnAreaChanged(ByVal sender As PartObject)
RaiseEvent AreaChanged(sender)
End Sub
End Class
Public Class PartObject
Dim m_Width As Single
Dim m_Height As Single
'Shared delegate that invokes OnAreaChanged method in PartsCollection
'without having to create an instance of PartsCollection
Private Shared delegateAreaChanged As New AreaChangedHandler(AddressOf PartsCollection.OnAreaChanged)
Property Height() As Single
Get
Return m_Height
End Get
Set(ByVal Value As Single)
m_Height = Value
Call AreaChanged()
End Set
End Property
Property Width() As Single
Get
Return m_Width
End Get
Set(ByVal Value As Single)
m_Width = Value
Call AreaChanged()
End Set
End Property
ReadOnly Property Area() As Single
Get
Return m_Height * m_Width
End Get
End Property
Protected Overridable Sub AreaChanged()
delegateAreaChanged.Invoke(Me)
End Sub
End Class
|
|
|
|
|
Hi!
i want to export data from Datagrid or (Dataset) in Excel or (CSV) in windows forms using Visual Basic .net
will someone guide me?
|
|
|
|
|
If you type 'excel' and 'export' into the search field of CodeProject you get several hits to start off:
http://www.codeproject.com/info/search.asp?cats=3&cats=4&cats=5&searchkw=excel+export&author=&sd=11%2F15%2F1999&ed=1%2F1%2F2005
They are mainly in C# but even if you you dont know C# at all you should be able to convert it to VB.Net by yourself.
|
|
|
|
|
Hi,
Wishing you all a very happy and prosperous new year.
I state my problem ,
My server socket looks for data from connected clients.
When a data is found it is stored in a file for further processing.
It's all happening but the first command being recieved from any client is being ignored as the server is just checking for a particular command.
Imagine the scenario ...i sent the data via the code:
Winsock1.SendData strTemp
in the server file it comes like
oÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌtÿÖperator play anil.pcm 2001
Though the second command onwards comes as is sent.
This has become a real headache to me..i dont understand how to get read of it.
Awaitng a quick reply
Thanks in advance.
amit mishra
|
|
|
|
|
I have an old OCX written several years ago (in C?). I have re-written this in VB6. It works fine, but the GUID is different to the original.
How can I make the GUID the same as that in the original OCX ?
|
|
|
|
|
what is a simple call to put into a click event to make sure the application fully terminates
VB 6.0 application
thanks
|
|
|
|
|
jlawren77 wrote:
what is a simple call to put into a click event to make sure the application fully terminates
What are you trying right now (maybe you could post a small code snippet)? If you say that the application keeps running it seems that there is some kind of processing (or wait) still going on.
Best regards
Dennis
|
|
|
|
|
its a simple unload me because all other forms have been unloaded through code.
I'm in my Fedora Os now, i'll post an update in a few.
|
|
|
|
|
jlawren77 wrote:
its a simple unload me because all other forms have been unloaded through code.
And that does not work? Because unloading all forms is the usual way of exiting a VB 6 application. You could use the End Statement[^] but doing so could have side effects as this statement causes the application to exit without triggering any Unload, QueryUnload, and Terminate events.
Best regards
Dennis
|
|
|
|
|
Hi all:
I consider myself an advanced beginner so decided to challenge myself.
What I'd like to do is create an app gives the user the ability to create tables similar to those found in Word. The app would NOT tie to a database, so grid control is out. Anyway, my understanding is that the grid control cannot support multiline, so that makes it impractical anyway. Table cells would be created on-the-fly (e.g. the user presses tab and a cell is added)
Here are some of the solutions I've considered:
1. Multiple text boxes - depending on the keypressed, a new text box either beside or below the previous box (to start a new row or column). The problem I see with this is that I'd have boxes of varying sizes, each with its own scrollbars.
2. Table control in asp.net - This appears to give me the table functions I need, but I don't want to require IIS be running. Would IIS be necessary?
3. System.Web.UI.HTMLControls (Table Class) - Could I in some way use these with the Active X Web Browser (shdocvw.dll) to run a VBScript and implement the controls.
4. System.Drawing classes - yikes, don't even want to go there
I know the generousity of the community and there will be those who write, "Here's a code snippet for you to use, try this..." While I appreciate that, right now, I'd just like someone to give me some hints, not specific answers.
TIA for any help.
Norm
|
|
|
|
|
Hi!
The DataGrid doesnt have to be bound to a database. It can be bound to several data structures. This cann be a DataTable which is generated programmatically without any reference to a database. It also has the possibility to write own ColumnStyles. These are classes that handle the way columns look in your grid. This way also multilined data can be presented.
1. Dont do this. Every textbox gets a window handle. This will be far too much overhead.
2. If you arent going to write a webapp dont use it.
3. In my opionen: No good idea. Again too much overhead and somehow ...hmmm... crumpy.
4. Why? The Drawing namespace can be fun. Although it can get very complicated.
I think you should take a WinForms grid control. You could take the DataGrid and bend it to your will or use some other grid (there is a cool one here on CodeProject - search for VirtualGrid).
My hint: Experiment a bit with the alternatives. This way you can get a feeling what can be done with each method and how long you will be sitting coding it.
|
|
|
|
|
Thanks Robert. Your comments were what I needed. I appreciate them. I'm going to look into the datagrid control more. It sounds like it has more potential than I thought.
Thanks again.
Norm
|
|
|
|
|
Hi Guys,
i m making a simple Counter in Asp.net with using Session,its Function is very Simple,Mean
User click on Button and then TextBox show the Count with One Increment,
Every Thing is Going Fine,But Problem is, if User Press "Refresh" button from Browser,So it shows one increment in Count.
So how can stop this.
Code is :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Count As Integer
If Not Session("Count") Is Nothing Then
Count = Session("Count")
End If
Count += 1
TextBox1.Text = Count
Session("Count") = Count
End Sub
Thanx in advance
Sajjad
|
|
|
|