November 20, 2012, 5:04 pm
I am getting and error where 80, 380 is and the Comma is getting a error it blatantly says ") expected"
Can someone tell me why it does this?
Code:
If e.KeyCode = Keys.Space And BtnSprite.Location = New Point(12, 330) <= (80, 380) Then
MsgBox("Txt here")
End If
Additional info: I wan it if the button sprite is within the location of 12, 330 and 8-, 380 to execute the msgbox. I was confused on how I can implicate between methods but there is none. There is Greater then and less then signs that do the trick.
↧
↧
November 20, 2012, 5:43 pm
have a checklistbox in windows application and am able to select the data items from checklistbox which is populated from database.& able to save the checked items in a tablebut not able to uncheck the checked items & remove from the database. I don't wan to uncheck all the checked items
Currently i have code for inserting checked items which is in for loop as
Code:
For i As Integer = 0 To Me.CHK_PRDT.CheckedItems.Count - 1
But my issue is suppose initally the user check 5 checkbox items and saves it .
later the user chooses to deselect 2 items from the selected 5 items and update the table
So I needed the code for deleting the unckecked items
The code that I have is
Code:
For i As Integer = 0 To CHK_PRDT.Items.Count - 1
If CHK_PRDT.CheckedItems.Item(i)("pid").ToString().Contains(CHK_PRDT.Items.Item(i)("pid")).ToString() = False Then
STR = "if exists(Select * from prdt_taken where pid=" & CInt(CHK_PRDT.Items.Item(i)("pid")) & " and cust_id=" & CInt(lblid.Text) & ")" _
& " delete from prdt_taken where pid=" & CInt(CHK_PRDT.Items.Item(i)("pid")) & " and cust_id=" & CInt(lblid.Text) & ""
............execute code using reader
End If
next
i get error
Index was outside the bounds of the array.
↧
November 20, 2012, 5:44 pm
I was stumped so i came here and hoped someone would know how to do this. I believe this is probably very easy or maybe its not possible but nothing is impossible
The basic Setup is
I have my app that launches another .exe i was wondering if it is possible to set a window size that the .exe will run in or possibly hidden where you cant see it.
the dimensions i look to set are 300x45 Its a very small status textline.
↧
November 20, 2012, 7:36 pm
I need help on how to code a command button (buttonclick1) to launch a program in the background I attempted to try to using ProcessStartInfo with CreateNoWindow and WindowStyle. I think it's possible to do it I just don't have experience and attempted to Use it but it was a total failure. So any help would be great.
↧
November 20, 2012, 9:31 pm
Hi guys,
Big thanks to everyone who has helped me over the past couple of weeks.
I am currently creating a line graph in one form using an array that I have stored in a module, the array is configured in another form. As a value is added to the array I would like the graph to recognize this and plot the new point.
To make this clearer, on a click event a number is stored in the array, that array is then used by the chart. The chart then plots the new point in front of the user.
Below is my code and in bold is how I am using my array with the chart.
Code:
With RChart.ChartAreas(0)
.AxisX.Minimum = 1
.AxisX.Maximum = 10
.AxisY.Minimum = 0
.AxisY.Maximum = 30
.AxisY.Interval = 10
.AxisX.Title = "Samples"
.AxisY.Title = "Range"
End With
RChart.Series("Range").MarkerStyle = MarkerStyle.Circle
RChart.Series("Range").MarkerColor = Color.Black
RChart.Series("Range").MarkerSize = 5
RChart.Series("Range").ChartType = DataVisualization.Charting.SeriesChartType.Line
RChart.Series("Range").Points.DataBindXY(pNumofSamples, pRange2)
So far I have tried:
Looping through the above code until the form is closed with application.doEvents() - this didn't work.
Calling a procedure that did the same as above, Setting a timer to iterate through the above code. For these I get the error "Enumeration already finished." Pointing to ---->
RChart.Series("Range").Points.DataBindXY(pNumofSamples, pRange2)
I have also tried multi-threading, using Me.CheckForIllegalCrossThreadCalls = False.. This also failed. I have had a search across the forum and can't seem to find a solution. I have read a bit about delegates and this could be a possible solution, however I'm wondering if anyone knows where I am going wrong or a way to solve my problem?
Again, appreciate the help.
Cheers.
↧
↧
November 20, 2012, 10:39 pm
I want to build an application that can verify address that is on a .CSV file.
The file will contain columns like this:
firstname, lastname, address1, address2, city, state, zip, country
Once the application see that if the zip is less than 5 digit it will list it on a datagrid or listview.
Another, if address1 or address2 contain a certain word it will list it on a datagrid or listview.
Another, if address1 or address2 contain a certain word it will search for another word and if that word exist it will display it on a datagrid or listview.
Also, I want to be able to save the listview as an Excel file.
If anyone is willing to help me please email me at <Email Removed>
Thank you
↧
November 20, 2012, 11:20 pm
hello :)
i have a problem with my project. the error is always related to database.savechages()
the inner execption say that :
{ "New transaction is not allowed because there are other threads running in the session."}
i'am not using more than 1 connection. i always dipose the connection at the end of the active action
i can't figure out what is the problem
someone help me please
↧
November 21, 2012, 12:32 am
i have a telephone number textbox that i have used the key down event to suppress any other keys besides 0-9 and the backspace key. i have a label beside it.
i want to display a message on lbltelephone when the user presses an alphabetic key that the textbox is for numbers only,and the message should disapper when the user inputs correct values...
currently i have
e.suppresskeypress=true
lbltelephone.text="no"
but the message does not disappear when user enters correct values and even if focus is lost
↧
November 21, 2012, 2:12 am
i have a telephone number textbox that i have used the key down event to suppress any other keys besides 0-9 and the backspace key. i have a label beside it.
i want to display a message on lbltelephone when the user presses an alphabetic key that the textbox is for numbers only,and the message should disapper when the user inputs correct values...
currently i have
e.suppresskeypress=true
lbltelephone.text="no"
↧
↧
November 21, 2012, 2:43 am
Hi guys,
with my VB2008 ver I did some simple code that loads a pdf into a pdf viewer with "AxAcroPDF1" command and it worked fine, but with my VB NET 2012
it returns error ,why?
Does anyone have an example of opening a pdf file into this "AxAcroPDF1" command from a specific location in the computer? in VB NET 2012
thanks
↧
November 21, 2012, 2:45 am
Hi,
I have the following update statement which works fine..
Code:
query = "UPDATE dbo.TblChangeControlDet SET UATComment=@UATComment, UATDate=@UATDate, UATApp=@UATApp WHERE ChangeID=@ChangeID"
cmdC = New SqlCommand(query, conn)
cmdC.Parameters.AddWithValue("@UATComment", txtUAT.Text)
cmdC.Parameters.AddWithValue("@UATDate", DateTime.Now)
cmdC.Parameters.AddWithValue("@UATApp", chkUATApp.Checked.ToString)
cmdC.Parameters.AddWithValue("@ChangeID", txtchangeID.Text)
cmdC.ExecuteNonQuery()
The issue is - UATComment field is optional, therefore, the user can option to leave it blank and update.
Prior to the update the UATComment is set as NULL value on the database.
Incase, the user updates without inserting anything to txtUAT.Text then the field records an empty field i.e., NULL is replaced by empty field.
UATComment is of datatype Nvarchar(Max).
Can I anyway retain the NULL incase the field was left blank prior to the update?
Thank you
↧
November 21, 2012, 2:56 am
Hi,
Ive written a VB app in VS2010 to list files in the windows\system32 directory on one of our 2008 R2 servers. At first glance, the output file list looks correct. Upon closer inspection its not showing an exe file that I have just copied into the directory. It seems that the directory is somehow being cached and that any attempts to view the directory pragmatically only shows what seems like a cached version. Using file explorer on the server shows the file I copied over.
For info I have full administrator access to the server in question
Ive tried many ways of listing the files. Some examples are listed below
Console.WriteLine("Method 1")
Dim diTop As New DirectoryInfo("c:\windows\system32")
For Each xxx As FileInfo In diTop.GetFiles("*", SearchOption.TopDirectoryOnly)
Debug.Print(xxx.FullName)
Console.WriteLine(xxx.FullName)
Next
Console.WriteLine("Method 2")
For Each File As String In System.IO.Directory.GetFiles("c:\windows\system32")
Debug.Print(File.Trim)
Console.WriteLine(File.Trim)
Next
Console.WriteLine("Method 3")
Dim tst As ICollection(Of String) = Nothing
tst = My.Computer.FileSystem.GetFiles("c:\windows\system32", FileIO.SearchOption.SearchTopLevelOnly)
For Each itm As String In tst
Debug.Print(itm)
Console.WriteLine(itm)
Next
Regards
Karl.
↧
November 21, 2012, 3:13 am
Hi every one, i am working in vb.net 2005 i have a little bit problem that:
Suppose exam table have 16 student exam result. i have to assign top 10 positions to each student
note: if multiple students have same result then position will be set same.
My question is that how i code for position to each student
Attachment 93459
↧
↧
November 21, 2012, 5:20 am
i am developing an application to calculate and grade students' marks in schools exams with vb 2010. i find it practically difficult to create a file extension for this program. i want the program to be able to save the work in its own format. what should i do? please help me out.
↧
November 21, 2012, 5:35 am
In one form of a certain app the Dock and Anchor properties have just seemed to quit working when the app is run (in the IDE they work fine). This is an existing app that was working fine before. I've had to go in and make some enhancements/changes and now when I run the app and resize the form, the position and size of the controls remains fixed. I've also got a StatusStrip docked to the bottom of the form and it doesn't stay docked when I resize the form. This issue is happening for this one form only. The other forms in the app work correctly. I did have code in the Form Resize event to handle the positioning of the controls but when I noticed the problem, I commented out the Resize Sub, and set the Anchor properties of a couple of controls, just to see if they would work. They didn't. So, does anybody know what could cause all the controls on a form to lose their dock/anchor functionality all at the same time?
↧
November 21, 2012, 5:41 pm
Hello guys.
I would be very grateful for your assistance. I want to know whether there is any means to cycle selection of entries in a Listview,
like as its done in a listbox such as the example below.
I need a listview equivalent to the Listbox sample as shown below.
Thank you all in advance.
LISTBOX ENTRY CYCLING SAMPLES:
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
With ListBox1
.Items.Add("AAAAAAAAA")
.Items.Add("BBBBBBBBB")
.Items.Add("CCCCCCCCC")
.Items.Add("DDDDDDDDD")
End With
End Sub
Private Sub cmdUp_Click(sender As System.Object, e As System.EventArgs) Handles cmdUp.Click
Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1
End Sub
Private Sub cmdDown_Click(sender As System.Object, e As System.EventArgs) Handles cmdDown.Click
Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex - 1
End Sub
↧
November 21, 2012, 7:24 pm
Hello VBForums,
So I have a listbox that has many items in it and I want to select x number of random items and add them in a string array.
Any solution with code or how would it work? I can't think straight at the moment cause I've been up for 30 hours. :sick:
To get more clear - x is not random it's a constant, the selected items have to be random. The listbox contains more items than x.
↧
↧
November 21, 2012, 8:44 pm
Hi,
I'm new in VB. I do have a datatable with a few columns. The first column having a unique values. How do I want read the particular column value and display it in textbox?
Say the datatable dt
Code:
ColumnA ColumnB ColumnC ColumnD
AB 123x 456y 789z
CD 123y 456y 789x
EF 234x 567x 789z
The ColumnA input is based on user input from textbox2. So I make it as variable let say "varA". So how I want to check what's the value for ColumnC based on variable from ColumnA and display it to textbox3?
What I do have now:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim varA As String
varA = TextBox2.Text
If dt.Rows.Contains(varA) Then
TextBox3.Text = dt.Rows.Item(2)("ColumnC").ToString '--> this is not work because I need the value based on the varA input by user. Please advice what should do here.
Else
MsgBox("No ColumnA value found", MsgBoxStyle.Critical)
End If
End Sub
Can somebody advice? Thanks in advance.
↧
November 21, 2012, 8:47 pm
hey all, i have a label with some text.the font of text is COLONNA MT, text color is dark green & size 32.
can i get the text with same formatting in my pdf ?
thanx in advance :)
↧
November 21, 2012, 9:02 pm
I've got the problem narrowed down, I just don't know how to fix it.
Here is an example code-
Variables for example:
Code:
Dim Username As String = Environment.UserName
Dim AppData As String = "C:\Users\" & Username & "\AppData\Roaming"
Zip and UnZip subs:
Code:
Public Sub MyZip(ByVal ContentFolder As String, ByVal CreateZip As String)
Using zip As ZipFile = New ZipFile()
zip.AddDirectory(ContentFolder)
zip.Save(CreateZip)
End Using
End Sub
Code:
Public Sub MyExtract(ByVal ZipToUnpack As String, ByVal UnpackDirectory As String)
Using zip As ZipFile = ZipFile.Read(ZipToUnpack)
Dim e As ZipEntry
For Each e In zip
e.Extract(UnpackDirectory, ExtractExistingFileAction.OverwriteSilently)
Next
End Using
End Sub
How I call the subs:
Code:
MyExtract(AppData & "\test.zip", AppData & "\testdirectory")
MyZip(AppData & "\testdirectory", AppData & "\test.zip")
All this works fine, but the problem is that DotNetZip will not take file locations in this form. I get this weird "FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path." error. If I just put the zip and folder names (instead of locations + names) it works fine but only looks in it's local directory. How do I get it to function as I need it to?
↧