|
What do you mean by monitor?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Here's a start[^]
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hello everyone
this is my first time here and i am very new to VB
I have a temperature Sensor and i got that to work
but my question is how can i have it disply 1 number after the deciaml like this 25.5oC insted of 25.345oC
i have been all day on this and i just cant get this one please help
Thare is my code for the Temp Sensor
Private Sub phidgetIFK_SensorChange(ByVal sender As Object, ByVal e As Phidgets.Events.SensorChangeEventArgs) Handles phidgetIFK.SensorChange
Dim temperature As String
phidgetIFK.sensors(0).Sensitivity = 2 '
temperature = ((phidgetIFK.sensors(0).Value * 0.2222) - 61.111)
txtNumSensors.Text = temperature.ToString()
End Sub
Thanks in advance
Y
|
|
|
|
|
You can use the Format method on the string class to specify how many decimal places to use.
Dim strPrice As String = dblPrice.ToString("0.0")
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for your help Christian
but i get a blue line under dblprice ???
do i put that with the code for the sencor or the text box code ??
i am usin Visual Basic 2008
Thanks
Y
|
|
|
|
|
Christian was just giving you an example. The blue line is because you apparently just copied the example code, but never determined the variable dblprice .
Anyway, forget that example, and adapt txtNumSensors.Text = temperature.ToString() in your own code to txtNumSensors.Text = temperature.ToString("0.0") , and Dim temperature As String to Dim temperature As Double
My advice is free, and you may get what you paid for.
|
|
|
|
|
I got My problem Solved
I want to Thanks Christian and Johan for your help
like i sayd i am very new to this but i have to start someware
i am almost done my Dummy book hehehe but i was getting frustrated
with this one
Agine Thanks Guys
Y
|
|
|
|
|
You're welcome.
The question you posted is exactly the kind of thing we are here to help with. If you are using a book (even VB for Dummies), and trying, then don't hesitate to ask any questions here on this board, even if you think they might be "stupid" questions (which they aren't).
Good luck.
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi,
I have a arraylist full of paths and want to show them in a treeview( like in Konqueror )
but I do not manage it.
An example:
Dir1/
Dir1/SubDir1/SubDir2/
Dir1/SubDir1/AnotherSubDir1/
Dir1/SubDir3/SubDir4/Subdir5/
Dir1/AnotherSubdir2/SubDir5/
They are no real directories
Please help!
Thanky very much!!!
modified on Wednesday, August 5, 2009 9:33 AM
|
|
|
|
|
Hi,
for each entry in the list, you must locate or create the items in the listview.
Here is the logic, with an example:
adding "Dir1/SubDir3/SubDir4/Subdir5/"
is Dir1 in the top level of the listview? yes, since you already did some entries.
is SubDir3 in the Dir1 level of the listview? no, so create it
is SubDir4 in the Dir1/SubDir3 level? no, so create it
etc.
Classes you will need include the System.IO.Path class to get path parts (alternatively you could use string.Split)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanky for your answer
but do you really write "listview"?
i guess you/i mean a treeview...
could you please give a piece of code
because i have some trouble finding the node where i have to add the new node
|
|
|
|
|
Hi,
I'm making an application which is supposed to be able to print sales statistics.
Any ideas on how to display the results from the query?
Ideally, the results shouldn't even be displayed in the application itself, only when the PrintPreviewDialog component is activated.
I could just input the results into a DataGridView but that doesn't look to good and I need to have the total sum of each column at the bottom of the column. I was thinking of exporting it to Excel but there must be a smoother way.
Any ideas?
All the best
|
|
|
|
|
If it is just for sake of prepare reports like thing, you can use SSRS.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
The thing is, I need to do it through the application, because the person using it will only be able to use the app, and not the DB.
|
|
|
|
|
If you have VS 2005 Professional, then Crystal Reports is part of that development enviornment. You would build the report using Crystal and have your VB invoke the Crystal report.
Or am I missing something?
|
|
|
|
|
I am using VS2008 Express verision.
|
|
|
|
|
I believe that version of Visual Studio does not have Crystal bundled with it; so you can't use that option. Bummer. You may want to investigate XSLT as a reporting option. You could write your report data out as an XML file and use XSLT to make it pretty for the user.
Unfortunately, I have no experience with XSLT. At my previous company I saw one of the other developers use it in a prototype. Check out the technology.
Another option would be to create Excel documents from your VB App.
Instantiate EXCEL like this, Dim ExcelApp As New Excel.Application and manipulate the Cells with loops around your result set. Not easy, but it would work.
|
|
|
|
|
Yeah, that was my next thought, but I want to avoid using excel for this one.
|
|
|
|
|
Hi,
I have a DataGridView control containing several columns one of which is a CheckBoxColumn. Clicking any of the CheckBoxes in this column fires the CellContentClick event which perfoms a task using the value of the clicked CheckBox. However, the value of the CheckBox doesn't seem to update until the cell loses focus, which is a problem for the task I am trying to achieve.
Anybody help me on this one? Thanks.
EDIT : Sorted it I think using the CommitEdit method of the grid.
modified on Wednesday, August 5, 2009 7:46 AM
|
|
|
|
|
Perhaps you can move the task from the CellContentClick event to the DataGrid's MouseUp event ?
Determine which cell has been clicked there, and because MouseUp happens after the rest, the CheckBox value should be resolved and ready for you to use.
My advice is free, and you may get what you paid for.
|
|
|
|
|
In the CellContentClick event, you will get the updated value in the EditedFormattedValue property of the cell and not in the Value property.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Great, just what I was looking for - thanks
|
|
|
|
|
For my project, I have setup a small domain, and arranged a LAN connection.
From my domain, when I connect with my Sqlserver 2008 remotely It's connected, no problem.And the application is running good.
But when I run the program, out of domain not in LAN, it's not connecting with my sql server and showing the error,
"A network-related or instance-specific error occurred while establishing a connection to sql server......(provider; Named pipes provider, error: 40- could not open a connection to sql server).
Any ideas to fix this problem ?
Thanks...
|
|
|
|
|
What connection string do you use?
My first thought would be your trying to log in to the sql-server using windows-authentication, try providing a login / pass (usually sa / <set during="" installation=""> works)
|
|
|
|
|
Iam using the followings as connection string
Dim ConStr As String = "Data Source=1.1.1.1; initial Catalog=Employee_Master; User Id=Codeproject; Password=xxxxxxxx"
It's cnnecting under LAN, but not with remote machines.
Thanks
|
|
|
|