Answer Questions
ivanatilca encoding issue in vb.net
I have vb.net app that requires input which is multilinugal data stored in SQL server in nvarchar field. For most of the time it works fine with forign languagaes. There are only couple of data items for which vb.net cannot understand data and " " is displayed inplace of actual character. When I open use SQL query analyzer I can see the characters in that languages. Since SQL query analyzer can show that data so I am assuming the data was correctly entered in database. The same vb.net code works with other chinese , taiwanese characters so nothing seems to be wrong with code either. Dose anyone know how to debug this problem. For database access I use ado.net... sqldatareader. So its when you are using t ...Show All
Jake52 migration from TrueBasic
I All I have the following conversion problem. In TrueBasic (an old structured Basic) nested routine were allowed. Look, for instance, the the following Module main Sub XXX() Dim a Sub ZZZ() Dim b End Sub End Sub Sub YYY() End Sub End Module In the above fragment the variable "a" and also "b" are seen from both XXX and ZZZ( this last is the nested procedure) but not from YYY. I do not succeed in reproducing this behavior in VB.net but I know that with all that power ( class, structure , module,etc) it is surely possible. Please, can somebody help me thank in advance Federico ...Show All
invantix Best method to restrict input
I need to restrict the input in a text box to '0 to 9' max 10 digits or 'NA' max 2 char. allowing for the backspace. Can anyone suggest the best method. If regex is suggested I would need the formula. Keypress event is not that great if you are going to allow 'na' also. Public Class Form1 Private Sub TextBox1_Validating( ByVal sender As Object , _ ByVal e As System.ComponentModel.CancelEventArgs) _ Handles TextBox1.Validating ' Use the 'maxlength' suggestion also Dim chk As Boolean = IsNumeric(TextBox1.Text) If Not TextBox1.Text.ToUpper = "NA" And Not chk Then MsgBox( "Must be num ...Show All
NeilAtTawanda Irritating algorithim.
I have tried many ways to get this to work but it just does not want to! Waaa! Could somebody help me PLEASE Here is my source code: Public Class POINTS_Calculator Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Req ...Show All
MuscleHead Write data in VB.NET to Access using SQL
Okay, I have an Administrator page that is able to create new users. I have a simple adduserform that has a TabControl added in it with a tab for General Info and User Info. Those have quite a few texboxes for input and outside of the TabControl are 3 buttons that are Save, Clear, and Exit. What I want to do is have the Save write the data to my small database that I have for users. If you want to see an example of my screen you can see it here.... http://redbearcustoms.no-ip.info/VB/adduserform.html please convert the image to a jpeg to reduce the size as it takes a while for it to load a bitmap image (raw) yes this can be done - to take values from each control, and insert into the database. The ins ...Show All
raq How to check if a value entered in a TextBox is a number
Hi, My program ask the user to enter a number in a textbox. I want to check if the value entered is a number (ex. : 23.543) and send a message to the user if its not a number. I want to do the same style of validation with a textbox where the user enters a filename. I want to check if the file exists. How can I do that I'm sure it's very simple but I can't find the code lines... Thanks! Implement the Validating event for the TextBox. For example: Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating If TextBox1.Text <> "" AndAlso Not IsNumeric(TextBox1.Text) Then MsgBox("Please ente ...Show All
Chardiot Change icon in treeview control
Could you please tell me how to change the icon when the 'plus/minus' sign in a treeview control is changed. For example, if the sign beside a node is "-", then display icon "A"; otherwise, display icon "B". I would highly appreciate your help! refer to http://p2p.wrox.com/topic.asp TOPIC_ID=35294 also http://www.obout.com/t2/ex_changeicons.aspx much better .. http://forum.java.sun.com/thread.jspa threadID=5133180&messageID=9481080 in java .. dear frnd if u find this helpful mark it as helpful n as answer as well.. thx.. tdcntt wrote: Hi Jay Vora, Thank you very much for your response! I am sorry that I forgot to mention the language. I am using C#. I am pretty new ...Show All
JacksonJones Date and time picker
I want to be able to give the user a simple interface for picking a single point in time, then for that to be formatted as DD/MM/YYYY hh:m:ss and put into a textbox. Public Class Form1 Dim WithEvents DTP As New DateTimePicker Dim WithEvents T As New TextBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load DTP.Format = DateTimePickerFormat.Custom DTP.CustomFormat = "dd/MM/yyyy HH:mm:ss" Me.Controls.Add(DTP) Me.Controls.Add(T) T.SetBounds(0, DTP.Bounds.Bottom, DTP.Width, 20) End Sub Private Sub DTP_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DTP.ValueChanged T.Text = DTP.Text End Sub End Class ...Show All
mEt Change system time using vb.net
Does anyone know how to change the system clock using code. I want to be able to set the date and time in my code. Any thoughts Thanks!!! indeed there is, try this: //create a structure: Structure SYSTEMTIME Public wYear As Short Public wMonth As Short Public wDayOfWeek As Short Public wDay As Short Public wHour As Short Public wMinute As Short Public wSecond As Short Public wMilliseconds As Short End Structure import the user32.dll (import the System.Runtime.InteropServices namespace): <DllImport( "kernel32.dll" , setLastError:= True )> public shared functio ...Show All
mimino Function to open a form, then when it is closed, return a value back to original form
Hi Guys! Basically I'm after a way I can open a form (say, form2 for the exercise), then when form2 is closed, the function will return a value from a textbox on form2, obviously calling the function from form1. I've got something like the following... #FORM2 Public Class Form2 Dim Showing As Boolean = True Public ReadOnly Property ValueIWant() As String Get ValueIWant = Me .TextBox.Text End Get End Property Public Function GetValueFromForm2() as String Me.Show() If Me. IsShowing = False Return Me. ValueIWant End Function Public ReadOnly Property IsShowing() As Boolean Get IsShowing = Showing End Get End Property 'There is also a sub that alters "Showing" to false when a button ...Show All
William Lowers Datagrid
How can I produce a total for values in a datagrid and them display them in a label the column index is the index of the column containing these values you wish to total up. so I may have 4 columns for example: Name Address Age Salary the ItemIndex( ColumnIndex ) would be 3 (since 0 = 1 in code) as I want to total up the Salary of all the employees in this case The code is placed wherever you wish to calculate up the totals and display it on the label. Does this help I guess you can go through each row, then get the column you wish to calculate the total from (so for each row and for a specific column using the ItemArray()) here is a pseudo: ...Show All
RibTickler System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Hi, I run an online Railroad simulation with a Community of some 60-70 players. Just recently 2 of the players have had to re-install Windows and hence the Simulation and now when they attempt to load it they get " System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)" No others are affected and indeed a couple of new players who have installed the game in the same period have had no problems. I have sent the affected players a list of the loaded Assemblies and both have confirmed all are present and correct. I am using VB Express with .NET Framework V2.0 and the DirectX Redistribution from October 2005 (ie Direct3DX 1.0.2908 with the other DirectX Assemblies ...Show All
losdude continuing file search after UnauthorizedAccessException error
I want to search an perticular .exe file on all the fixed drives (c:, d:, ....) and then replace it with another same named file. I am trying to get it but could not. With try catch method the search is stopped with 'UnauthorizedAccessException'. I have given the following code Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim folder As String = "c:\" Dim pattern As String = "example.exe" Try For Each file As String In My.Computer.FileSystem.GetFiles(folder, FileIO.SearchOption.SearchAllSubDirectories, pattern) MessageBox.Show(file) Next Catch ex As UnauthorizedAccessException MsgBox(Err.Description) End ...Show All
GoDaddy Unsigned Arithmetic and overflows
I've had this discussion before with unint64s. Setting what would normally be the sign bit causes an overflow. Now I'm seeing this in unint32s. Dim a As UInt32 = System.Drawing.Color.Black.ToArgb will cause and overflow. Dim a as Uint32 = now.ticks and &hFFFFFFFF will cause an overflow depending in the time. This should not be. What it means effectively is the UInt32 is actually UInt31. Hi Mike, I liked your last question because it was interesting. I would prefer that simple case because without it there is a loss of control for the programmer. How is the following evaluated Dim a as uint32 a = 1 << 31 That's illegal where a = 1 << 30 Is legal. Are those evaluated as cons ...Show All
HelenM Only numbers in a textbox
Hi is there a way to alow only numbers in a textbox Reagrds alvin Hi alvin, if you are not bound to use TextBox you could try NumericUpDown or MaskedTextBox. The first allows digits only be default and adds a spin up/down arrow. The second can be controlled with the Mask property. If you set it to 0######### you specify that at least one digit must be entered and you allow up do 10 digits. If you want to stick with TextBox you can override the KeyPress event like so: private void textBox1_KeyPress ( object sender , KeyPressEventArgs e ) { if ( e . KeyChar < '0' || e . KeyChar > '9' ) e . Handled = true ; } -- SvenC you could also ...Show All
