|
|
I have created a text box that I would like to display history in. For instance with Start/Run how it shows like the past 15 entries on the dropdown. Can anybody help?
|
|
|
|
|
where are you struggling?
is a mult-lined textbox?
To add a new line to the text box:
textbox1.text &= "new line" & controlchars.crlf
if i'm not even close, then please explain
|
|
|
|
|
Get the last n values from the registry at load, into an array.
Read the keypress event for the arrow keys, and show the next/prev values from the array.
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.
|
|
|
|
|
The array contains many elements, some of them have the same value, now I need to count how many bins (value of the same elements) and number of elements of each bins. It's like plotting a histogram for a group of data.
is there a easy way to do it?
Thank you.
|
|
|
|
|
Dim ia() As Int16 = {0, 3, 6, 2, 3, 5, 6, 5, 34, 2, 2, 3, 45, 6, 78, 89, 78, 6, 45, 43}
Dim iaBin(,) As Int16 = Nothing, bFound As Boolean
ReDim iaBin(1, 0)
For i As Int16 = 0 To ia.GetUpperBound(0)
bFound = False
For j As Int16 = 0 To iaBin.GetUpperBound(1)
If iaBin(0, j) = ia(i) Then
iaBin(1, j) += 1
bFound = True
Exit For
End If
Next
If Not bFound Then
ReDim Preserve iaBin(1, iaBin.GetUpperBound(1) + 1)
iaBin(0, iaBin.GetUpperBound(1)) = ia(i)
iaBin(1, iaBin.GetUpperBound(1)) = 1
End If
Next
For i As Int16 = 0 To iaBin.GetUpperBound(1)
MsgBox(iaBin(0, i) & "::" & iaBin(1, i))
Next
|
|
|
|
|
Hey Guys,
Can anyone provide me with a simple function or method:
How to read Pixel of a image when a mouse is clicked in a specific location
Regards
Ramy
|
|
|
|
|
Check out Image.GetPixel and Control.MousePosition
|
|
|
|
|
I need to know how to replace an * with an empty space. When I try to format the cost I get the following error: Conversion from string " *65090" to type 'Single' is not valid.
Here is some sample code to give you an idea of what I am doing:
FormatCost = Format(CSng(row("dealernetpricedollars")), "c").ToString()
Replace(row("suggestedretailprice"), "*", "").ToString()
FormatMSRP = Format(CSng(row("suggestedretailprice")), "c").ToString()
I have some replace code but I am still getting the same error.
Any info would help. Thanks!
jds1207
|
|
|
|
|
Your getting the error because the "replace" is a function. It will return the result. It doesn't change the actual expression.
Dim sSuggestedretailprice as string = replace(row("suggestedretailprice"),"*","")
FormatMSRP = Format(CSng(sSuggestedretailprice), "c").ToString()
|
|
|
|
|
|
Hi,
I'm working on a small VB.NET 2003 utility for my employer whereby I need to read in the contents of a text file, put it into a datagrid, and sum the totals for two of the columns.
I've had a quick look around, and all I keep on finding is reference to the 'split' command.
The problem is that there are no definitive splits in the text file.
The source text file is really messy, but it does have a structure that I hope I can work with. I have worked out that the lines I need to import all begin with a single character, "K". The columns (on these lines beginning with "K") that I need to import and work with, for example, start on character number 8, which references a product code, and is (for example) 8 characters in length. The next 'column' of information starts on character number 20, and is a numeric value covering 10 chars. Immediately after this 'column' (no spaces in between!) is another numeric value - again 10 characters in length.
What I want to do is put this data into a datagrid, and sum the numeric columns.
Any help would be appreciated.
|
|
|
|
|
Perhaps you could use something like this?
Not very elegant...
<br />
Dim fs1 As New FileStream("C:\keysdig2.dbf", FileMode.Open, FileAccess.Read)<br />
Dim sr1 As New BinaryReader(fs1)<br />
Dim strMyNum As String<br />
Dim dt As DataTable<br />
Dim dr As DataRow<br />
Do While sr1.PeekChar <> -1<br />
dr = dt.NewRow<br />
If sr1.PeekChar = "K" Then<br />
'Read 8 chars to get to the first number of interest<br />
For i As Integer = 0 To 7<br />
sr1.ReadChar()<br />
Next<br />
'First Number (10 Chars)<br />
For j As Integer = 0 To 9<br />
strMyNum += sr1.ReadChar.ToString<br />
Next<br />
dr.Item(0) = strMyNum 'Place in first Col of Datarow<br />
strMyNum = ""<br />
'Second Number (8 Chars)<br />
For k As Integer = 0 To 7<br />
strMyNum += sr1.ReadChar.ToString<br />
Next<br />
dr.Item(1) = strMyNum 'Place in Second Col of Datarow<br />
strMyNum = ""<br />
<br />
dt.Rows.Add(dr)<br />
End If<br />
Loop<br />
|
|
|
|
|
im using .net 2k3, office 2k3
well every thing was working fine, but after a week during which i've
not edited/used my code !!! and now everything is in mess...
please help me to solve this problem..
dim applicationObject As Object
WithEvents outApp As Outlook.Application
while assigning,
outApp = applicationObject
i'm getting error,
message => "Could not load type
Outlook.ApplicationEvents_11_NewMailEventHandler from assembly
Interop.Outlook, Version=9.1.0.0, Culture=neutral, PublicKeyToken=null."
Err.Number => 429
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Kedar V wrote: well every thing was working fine, but after a week during which i've
not edited/used my code !!! and now everything is in mess...
A common mistake is to believe that something is correct, just because it works.
Here's an article that might help:
You receive run-time error 429...[^]
---
b { font-weight: normal; }
|
|
|
|
|
well right said !!!
but this does work with outlook 2002(XP) but not with outlook 2003 !!
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
VB.net 2005 & SQL 2005
Hi all, this is a three part question, as im to lazy to put up three different posts.
The project is an application that contains several forms, all accesses from a main form
Q1.
Once the user is logged on they arrive at the 'main menu'. what id like to try and do is dynamicaly create the options on that form dependant on what they are allowed to do ( this can be obtained via SQL query )
there is a table in the database that holds all the form names, display names and security level
What id like to do is display only those 'display names' that the user have the releven security level to, and have the onclick event . to redirect them when the select a form
I know there are some real wizz guys out there, but inststead of just throwing code, can some one give an example and explian what its doing so i can at least learn from this
Q2.
In the old vb6 there was a 'status' panel that i used to stick in info like current user , time etc. the questio is is there a similar control or would it be more prudant to create a custom control and if so how?. Is there a sim[ple way of having this on every form without having to code it every time....
Q3.
Form Settings. Currently i have a function that i call from every form that paints the form a certain colour, is there a better way to do this rather than calling a function on each forms 'load' event.
once again thanks for all you help ... this site is a great learning tool.. keep up the good work!!
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
Q1,
The easiest way to do this is to put every possible option on the form and through security disable the options that available for the user. If you wanted to hide them instead, you then would just need code to bunch the options together instead of leaving gaps.
I did create an application that built the entire form via a database table. there is a lot of code to do it, but it is possible. the "bueaty" of that kind of thing is that you don't have to distribute any changes to the end user. change the database and they immediately get the change the next time they run the app.
Q2,
There is a status bar in the toolbox of dotnet. If you want to put custom code around, then make a user control that includes the status bar and then you only need to put the user control on each form and then all the code is bound in the control and all forms will use it in the same way.
Q3,
Look at inheritence. If you make a form that all your forms inherit from then you can make all your forms, have the same events (paint), variables, etc.
Example: gradient back ground for every form that inherits from it...
Public Class FormBase
Inherits System.Windows.Forms.Form
Protected Sub FormPaintEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
CType(sender, System.Windows.Forms.Form).BackColor = Nothing
Dim formGraphics As System.Drawing.Graphics = e.Graphics
Dim gradientBrush As System.Drawing.Drawing2D.LinearGradientBrush
gradientBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New System.Drawing.Point(0, 0), _
New System.Drawing.Point(sender.Width, 0), _
Color.FromArgb(221, 236, 254), _
Color.FromArgb(129, 169, 226))
formGraphics.FillRectangle(gradientBrush, sender.ClientRectangle)
End Sub
End Class
Public Class MainMenu
Inherits FormBase
end Class
|
|
|
|
|
Hi,
When VB.NET application is loading i need to close all the opened application like Notepad, Folder, Word, Winamp etc.,
Can any one give me the code to close all the apllication using VB.NET
Regards,
Senthil V.
|
|
|
|
|
i don't think that this methode is the best one. U can call on the user, that their programms should be closed, but when u kill all running processes, u may kill important data. and if u want this, u're aspiration doseen't go for the user but against the user..
|
|
|
|
|
ok thanks for advice. I am creating the Setup in VB.NET there in User's Startup Folder im setting to run my application. So that the user can able to open any application in the sytem. But what the problem when im loading the machine it take few minutes to load the project. Give me u'r suggestion to make the project load quick when Operating System loaded.
|
|
|
|
|
There really isn't much you can do. If the O/S is still starting up, which is entirely possible even though the user has a desktop showing, you have to wait for the O/S to completely start all of its services adn the same time you're waiting for it to load and start the .NET CLR with your application. You can get some benefit from NGen when you install your application on these machines, but the benefit will be small.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
Where do I find Sub New of a form in VS2005. Since the 'Windows Generated Code' is no longer visible.
Richard
|
|
|
|
|
Yes it is, it's in a seperate class. But, I think VB.NET (hideously) generates it for you magically. I think you just need to add it manually and it will use the one you provide, but I could be wrong.
|
|
|
|
|
no it hasn't this procedure cause it dosen't need it, cause
1. the class is marked as "Partial" and not as "Public"
2. the class-procedure is called mostly from the new procedure from it's owner-class..
|
|
|
|
|