|
You asked how to know if the value is numeric... since the question was posed in a VB forum, the answer given is the function to test a value in VB.
How the application handles this is another question entirely and beyond the scope of the first question.
|
|
|
|
|
FormatCost = Format(CSng(row("dealernetpricedollars")), "c").ToString()
If isNumeric(FormatCost) = True Then
' Some Code to handle True Condition
Else
' Some code to handle False Condition
End If
DDscales
|
|
|
|
|
I want to take control of installed printers on my computer (network) and from any computer on the network, send data directly for printing.
Could anyone help with some concepts and example code?
omo code
|
|
|
|
|
First, the disclaimer: I have ZERO experience with VB. However, I have been tasked with writing some code for some intensive calculations using VB in Excel. I have discovered that to write data from an array to the Excel worksheet, you can use the following:
Worksheets("Sheet2").Range("A2").Resize(1, UpperLimit).Value = ConvDataEuro
Where UpperLimit is the size of the row and ConvDataEuro is the array holding my data. However, I need to write in excess of 400 array elements and the row limit on Excel is 256. Thus, I want to write the data in columns rather than rows. Unfortunately, this is apparently not easy to do as I have spent the last hour trying to do this with zero success.
So, my question is: how do I take array data and write it to a column in Excel instead of a row? This should be simple, but under VB in Excel it is not intuitive.
TIA.
|
|
|
|
|
1. This is not truly a VB question; it is an Excel question. All languages will be constrained by the object model.
2. Played with the VBA briefly: reverse your resize parameters (UpperLimit, 1)... that appears to work.
YWIA.
Tim
|
|
|
|
|
Hi Tim,
Thanks for the help. I tried switching the limits and what it does is that it prints out an entire column length of the first entry of the array. I managed to get it to work using an alternate method (I am sure, however that there is a better way) whereby I loop through the array and print out each element of the array while incrementing the spreadsheet cell. Like I said, I am sure there is a better/more efficient way of doing this.
Thanks for the answer though - when I have some free time I'll try again.
Also, where else was I to post the question, the Lounge perhaps?
|
|
|
|
|
I have no problem with the question being posed here... and posting it in the Lounge or Soapbox would have resulted in a flaming...
I don't like to use Excel, but, I am required to do so.
I have been bit a number of times by the way it handles Ranges, so, I just don't use them and opt instead for the method you used - loop and fill.
If you have other Excel/VBA questions, ask away... I will answer what I can.
Tim
|
|
|
|
|
I am a VB.net student and have had a relatively easy go of it til now. For some reason the concept of threading has been a problem for me. Our assignment is to make a ball bounce around the screen (changing directions when it hits a wall). It must us a class (ball). and I understand the basic code of making the ball change directions, but have no idea on how to incorporate this using threads. Any pointers or starters would be great.
|
|
|
|
|
Hi mydrive22.
Every application when start has a thread (Primary Thread [PT]).
The Thread is a subprocess, this run at same time that PT.
For example: When you walk and talk, if this process was a only process you need wait for walk process finish and start the talk process. but if you start 1 process for walk and 1 process for talk, the PT proceess is free for do anything.
It's the same with forms.
If you use one proceess for retrieve data, you can use the PT for do anything on the form.
You need study "System.Threading", "Control.BeginInvoke", "Control.EndInvoke", "System.MulticastDelegate"
I hope that this solve your problem
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|
Hi,
I have a form which stores regular values(INTO a USER Table) inputed on the same form, in the following way:
objUser.strUsername = System.Convert.ToString(Me.txtUsername.Text)<br />
.<br />
.<br />
.<br />
.<br />
etc..
The problem is, I am trying to store a value INTO the USER Table, from ANOTHER form. I can't do:
objTitle.strTitleName = System.Convert.ToString(frmTitle.txtUsername.Text)
What do I do ?
The thing is the Title being inputed is a checkbox format anyway, NOT a TextBox..
Thanks for the help.
|
|
|
|
|
1) system.convert.tostring is not necessary. the property 'text' is already a string. not need to convert a string into a string.
2) you either need to make the control accessible publically or you can create a readonly property that returns the control's text property.
|
|
|
|
|
Hey guys!
I have drawn a Heart, now I want to know how do we fill it with a color once drawn ¿
The reason I'm asking this, is because adding a GraphicsPath and Filling that path, didn't seem to work. I even declared a new Points array, and tried FillPolygon, but that didn't work either.
This is what I've done with the Graphicspath
Private startPoint As System.Drawing.Point
Private endPoint As System.Drawing.Point
Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
startPoint.X = e.X
startPoint.Y = e.Y
End Sub
Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
endPoint.X = e.X
endPoint.Y = e.Y
Panel1.Invalidate()
End Sub
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Dim hPath As New System.Drawing.Drawing2D.GraphicsPath
Dim width As Integer = Math.Max(endPoint.X, startPoint.X) - Math.Min(endPoint.X, startPoint.X)
Dim height As Integer = Math.Max(endPoint.Y, startPoint.Y) - Math.Min(endPoint.Y, startPoint.Y)
Dim avg As Integer = CInt((width + height) / 2)
If avg > 0 Then
Dim topLeftCorner As Point = startPoint
If endPoint.X < startPoint.X Then
topLeftCorner.X = endPoint.X
End If
If endPoint.Y < startPoint.Y Then
topLeftCorner.Y = endPoint.Y
End If
Dim radius As Integer = CInt(avg / 2)
Dim topLeftSquare As New Rectangle(topLeftCorner.X, topLeftCorner.Y, radius, radius)
Dim topRightSquare As New Rectangle(topLeftCorner.X + radius, topLeftCorner.Y, radius, radius)
e.Graphics.DrawArc(Pens.Black, topLeftSquare, 180.0F, 180.0F)
hPath.AddArc(topLeftSquare, 180.0F, 180.0F)
e.Graphics.DrawArc(Pens.Black, topRightSquare, 180.0F, 180.0F)
hPath.AddArc(topRightSquare, 180.0F, 180.0F)
e.Graphics.DrawLine(Pens.Black, topLeftCorner.X, (topLeftCorner.Y + radius) - CInt((radius / 2)), topLeftCorner.X + radius, topLeftCorner.Y + avg)
hPath.AddLine(topLeftCorner.X, (topLeftCorner.Y + radius) - CInt((radius / 2)), topLeftCorner.X + radius, topLeftCorner.Y + avg)
e.Graphics.DrawLine(Pens.Black, topLeftCorner.X + avg, (topLeftCorner.Y + radius) - CInt((radius / 2)), topLeftCorner.X + radius, topLeftCorner.Y + avg)
hPath.AddLine(topLeftCorner.X + avg, (topLeftCorner.Y + radius) - CInt((radius / 2)), topLeftCorner.X + radius, topLeftCorner.Y + avg)
e.Graphics.FillPath(Brushes.Black, hPath)
End If
End Sub
But it only fills the part with the 2 arcs, and not the lines - so only the top half of the heart is filled.
Any ideas on how I can fill the entire Heart shape while drawing ¿
|
|
|
|
|
I'm looking for a way to intercept the shutdown/log off of a computer to run my own app then let the computer continue to shutdown/log off. Is this possible and how?
|
+-- JDMils
|
+-- VB6
+-- VB Dot Net
|
|
|
|
|
|
One obvious thing to do is to run your code ( it has to be running no matter what ) and just perform your action in your programs close event handler.
|
|
|
|
|
The shutdown/log off action is started by the user. My app needs to detect when this happens then run an external application.
Upto this point, I am OK. When the external application finishes, I need my app to continue with the shutdown/logoff. How do I detect whether the computer was originally shutting down or logging off?
Another question, is once my application completes, and it issues a shutdown/log off to continue the original request (by the user) to shutdown/log off, how do I stop my app from running again!? LoL
Thanks
|
+-- JDMils
|
+-- VB6
+-- VB Dot Net
|
|
|
|
|
|
Hi!
I'm a beginner in VB.NET. I try to change treenode text value: Press rightmouse's button. Select "Rename". How can I do as well as window!
Please, help me!
Thanks!
THT
|
|
|
|
|
I have to include one popup on my Page for confirmation of delete operation,Which will have ok and cancel buttons,
Please help me at earliest.
|
|
|
|
|
This post should go into the ASP.NET or Web Development section...
Anways: use the JavaScript's "confirm()" function (google for details)
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello,
vb 2005, sql server 2005, winforms.
My problem is that how do I find the index of the number of the checked items. The code below is what I have done so far. However, I con't find any properties that will allow me to find this index number. Any advice would be more grateful
For example, if the has checked indexes 2, 5, 10, 15. How can i find the indexes of the checked items.
<br />
Dim i As Integer <br />
Dim dt As New DataTable() <br />
Dim dr As DataRow <br />
Dim userID As Integer <br />
<br />
dt.Columns.Add("UserID") <br />
dt.Columns.Add("GroupID") <br />
For i = 0 To Me.chkLstSecurityRoles.CheckedItems.Count - 1 <br />
dr = dt.NewRow() <br />
dr("UserID") = userID <br />
dr("GroupID") = 'The index number of the checked item that have been clicked<br />
Next<br />
Thank for you help in advance,
Steve
-- modified at 4:26 Monday 13th November, 2006
|
|
|
|
|
I had a similar problem a long while ago, cant remember exactly how to help you. Lol. If you search this forum, however with the author as "ANZAC", you should find the thread and the title will say something about checklistbox.
Posted by The ANZAC
|
|
|
|
|
Hi
Is there any way to program a console application in VB6
One more thing
Is ther any way to have command line compilation in VB6
Thnks in advance
bye
pitchu
|
|
|
|
|
Hi
You can certainly write console applications using VB6 (just write your code in a module and have it called in the app startup) but why would you want to use VB6 for this purpose?
Chandra
|
|
|
|
|
Hi,
I want to hide IE's menubar, toolbar and addressbar while my home page will load. can anyone help to resolve this with vb.net?
TC
|
|
|
|
|
Hi,
I think you will have to use javascript. When opening new window options are available for hiding menubar, toolbar and addressbar.
Hope this helps.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Can u Give me the example of the same??
v
|
|
|
|
|