So I have no idea...ive looked around and can't find anything on error traping when a person doens't enter anything. Here is my code as is now...I trap for if the number goes above 36. now I just need to trap the whitespace
must stop the user from proceeding if the textbox is null,if the textbox has only spaces in it.i tried . trim but that doesnot work, still spaces are excapted as valid characters.
I am trying to remove the white space around a toolstripcontrolhost control which hosts a calendar control in a contextmenu. See the attached image and code.
VB: Dim menuItem As ToolStripMenuItem = New ToolStripMenuItem("MyMenu") Dim calControl As New MonthCalendar
I'm trying to build a list that will be used as the in clause of a select statement. The requirement is to have the user enter a comma separated list of descriptions. Each description can contain spaces so I can't remove the spaces before splitting by comma to add the single quotes around each description. I want to remove all white space after a single quote since no description will start with a space. What's the best way to do this in VB.NET? Regular expression or a string function? Here's what I have so far.
how can i replace the enter key event present in an ASP variable with a white space i tried a lot but bad luck...Actually there is no character like vbCrlf or <br> in the string actually I am getting ...it is an enter key event present in the string taken from a textarea ..... My attacks on this issue:
How do I stop the new data row/cell value from being deleted if an error occurs. I am using the DATAERROR event to trap the error as shown below:
Private Sub RoomPricingDGV_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles RoomPricingDGV.DataError e.Cancel = False If e.ColumnIndex = 1 Or e.ColumnIndex = 2 Then MsgBox("Invalid Date. Please Re-enter! ", MsgBoxStyle.Critical, "Room Pricing") RoomPricingDGV.Columns(e.ColumnIndex).Selected = True End If e.ThrowException = False End Sub
What I want to happen is to go to the cell automatically where the error has occurred and get the user to change it, not have to retype the whole data row or move back to the previous cell. When using the MSHFLEXGRID in VB6, it was fairly staightforward to do.
i want to enter date in the format of dd/mm/yyyy (30/03/2009) in a textbox. when a click on the button, if nothing or wrong format is enter, will pop up msgbox saying wrong format.
I have a textbox that is used to add directories to a system folder, each name seperated by a line. If the textbox has text value "Test " that is "Test" & controlchars.newline & "" (not like this is coded, it's typed in), then if i use loop for each part as string in textbox1.text.split(controlchars.newline), the first part will be "Test", the second part will say " " when i run step by step debugger, but if i try and block the addition of a folder by "if part = " "" it does not catch it. I've tried comparing part to "", " ", nothing (which is illogical anyways), and i even tried creating a boolean variable equal to the statment to try and catch it but the program insists that part is not " " even though the debugger tells me that is the value of part.
How would i get a certain text inside a textbox to equal that text space to space or null to space?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Textbox1.Text.StartsWith(Textbox2.Text + " ") And Not String.IsNullOrEmpty(Textbox2.Text) Then Textbox1.Text = Textbox1.Text.Remove(0, Textbox2.TextLength) Textbox3.AppendText("a") End If
Btw: after i finish this step my project will be finished!
How can I set up an application wide event trap that is triggered when my database connection status changes?i.e. no matter what form the user may be on if the connection is terminated for whatever reason a message box is displayed to the client requesting whether the program should try and reconnect with the database or not.
I have a file search method, but I have a question about it.
THis is the code
Dim MySearch As New FileSearcher("D:", "tomb2.exe", False) Dim Results As Specialized.StringCollection = MySearch.Results For Each tstr As String In Results ListBox1.Items.Add(tstr) Next
I have other files too : tomb3.exe, and tomb4.exe I'd like to have those to search at once too. I tried "tomb*.exe", but then it didn't find anything.
How can I set the space between tomb and .exe to anything. So it searches all files that begin with tomb and end with .exe ?
We utilize quotas on our file share using the built in Window quota system. The problem is that doing a dir or using .NET to check available space, only shows the actual space of the hard drive. It seems there is no way (that I have yet found) to get the quota size available to the currently logged in user.
I'm still in the learning stages sorry, and this is probably simple to most of you but I couldn't find the answer through searching.I'm trying to work out how to replace each successive space in a piece of text with a single character from "% $ ! @ #" in that order, and loop.
Easier to explain with an example;say I have the text: "This is a piece of text I am using as an example."
It should end up looking like this: "This%is$a!piece@of#text%I$am!using@as#an%example."
Frankly, NONE of this makes sense to me..[URL]..They just jump right into code without baby steps that explain the situation.Every other aspect of VBnet has been well spelled out to me and I get it -- but this business of using the serial port and going nowhere because of a cross thread error has me 100% baffled.
If anyone can point me to a tutorial that really explains it simply and well (without jumping into friggin' code).Even in the above link, they show 3 different techniques of addressing the same problem ! (Like I CARE
When creating a menu, there is a large gap to the left of the entry. This is where the icons usually go. Is there a way to remove the space if you want a menu without icons?
I am using a picture box. I want to be able to use the Space or Enter key to change the image in it. For that, I try to use the keydown function as follow:
Private Sub ChestWindow_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Select Case e.KeyCode Case Keys.NumPad1[code]....
is the function which changes the image. It works well when I press '1' on my numeric part of the keyboard as a test.The issue is that when I press Space or Enter, the form containing the picturebox closes. (I've already put the keyPreview property to True)
I'm trying to make the progress bar to display the amount of free space C: has. I have successfully do so with my code which is:
Vb.net Try Dim b As String Dim c As String Dim dvr As New DriveInfo("c:") b = CStr(dvr.TotalSize 1000000) c = CStr(dvr.AvailableFreeSpace 1000000) [Code] .....
As a last touch to this code I thought I would add a percent bar so it would look more professional. I did so with: Dim Per As String = (c b * 100) The problem is that it displays always zero percent why?