|
Hi everyone,
I have a textbox which holds numbers like e.g., xxxxxx
I wonder how to change that value entered by the user to xx-xx-xx. I'm trying several regular expressions like: OpNumbers.Replace(OpNumbers, "^(\d{6}|(\d{2}-\d{2}-\{2}))$") and also :
Format(lblOPReferenceNumber.Text.Trim, "## - ## - ##").
I'm not getting the output that need it. I'm pretty sure that I might be doing something wrong at some point.
Thank you for you help.
Venecos
|
|
|
|
|
Do you need leading zeros? Then you must use "0" instead of "#".
Dim number as int = int.Parse(textbox1.Text)
Dim result as string = number.ToString("00 - 00 - 00")
Dim result2 as string = number.ToString("## - ## - ##")
|
|
|
|
|
Alternatively, if you want to show the user the fomatted text, the MaskedTextBox control with
Mask property set as below may be used
MaskTextBox1.Mask = "00 - 00 - 00"
maskedTextBox1.TextMaskFormat = MaskFormat.IncludePromptAndLiterals
string maskedText = maskedTextBox1.Text
maskedText = maskedText.Replace("_","0")
The mask characters are explained here
http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx[^]
|
|
|
|
|
i want to create 2 combobox
st combobox = country
nd combobox = district/region
st combobox is the country combobox. when i choose one country , the nd combobox will change / auto populate all the region based on the selected country .
all the data is populate from access database
. im new to VB . appreciate ur help 
|
|
|
|
|
A combobox has an event for the change of a selection, e.g. SelectionChanged or SelectedIndexChanged . In the corresponding event handler, get the SelectedItem of the combobox. Caution: it might be "Nothing". If it is not Nothing, query your database to get the regions. Make the regions combobox empty (e.g. comboregions.Items.Clear() ), and fill the new data into it. You could then set the SelectedIndex to 0 to preselect the first item in the combobox.
|
|
|
|
|
The solution given by Bernhard Hiller works fine.
Another option is in the DataSet designer or programmatically, create a relation between Country and Region DataTables like
Relation Name: CountryRegion
Parent Table: Country, primary key: CountryID
Child Table: Region, Foreign key: CountryID
Dim CountryBindingSource As New BindingSource(DataSet1, "Country")
Dim RegionBindingSource As New BindingSource(CountryBindingSource, "CountryRegion")
comboBox1.DataSource = CountryBindingSource
comboBox1.DisplayMember = "Country"
comboBox1.ValueMember = "CountryID"
comboBox2.DataSource = RegionBindingSource
comboBox2.DisplayMember = "Region"
comboBox2.ValueMember = "RegionID"
|
|
|
|
|
I have this assignment but I'm not getting any ideas. I have to create a program which sort people into a specified number of groups. I need help.
|
|
|
|
|
You may not get any ideas if you dont explain the problem properly.
On what basis do you have to sort the people into groups? without this it would be difficult to provide any help.
Every new day is another chance to change your life.
|
|
|
|
|
the user states how many groups he wants.
|
|
|
|
|
I would create a Person class that contains properties for each aspect I will need to group by. Then I could use LinQ to group by any property. For more help you will need to provide more information, I'm afraid.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
we have to design a program that will accept a list of names of people and the group them into a number of groups the user chooses.
|
|
|
|
|
Does this mean that the groups should each have a certain equal number of people in them, or must they be grouped by name or what ? You need to be more specific.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Ya, the user specifies them and the program does it. the user will specify the number of groups he wants and the program will accept the list and group them.
|
|
|
|
|
You will get help Marvolo,just explain a bit more. What & how exactly you need it.
|
|
|
|
|
the user specifies them and the program does it. the user will specify the number of groups he wants and the program will accept the list and group them.
|
|
|
|
|
|
Your question is not at all clear. You need to provide more information.
like
1. How the combo box is populate ( from a file or Hard coding)
2. From where the data get loaded in the chart? (From file or any other medium)
Every new day is another chance to change your life.
|
|
|
|
|
i will tell u later bro . i need to do the chaining combobox first(but i still cant do that ).
because the chart will populate data based on the selected combobox.
|
|
|
|
|
what are the methods of connection and transfer of data between two different system with vb.net
Server client scenario....
|
|
|
|
|
There's only about a hundred of them... Be a little more specific with your questions.
|
|
|
|
|
scenario ...
Their is system 1 stays online ... now other system request data time to time and gets data transferred as first as possible...
|
|
|
|
|
Please provide me sum suitable reference to me
|
|
|
|
|
I think you are looking for this [^]
Every new day is another chance to change your life.
|
|
|
|
|
Hi everyone,
I try to run an exe to a windows 2000 but an error occurs
The dynamic link library mscoree.dll could not be found in the specified path...
so I put the mscoree.dll to the exe location, but when I try to run the exe again this error appears
A fatal error occured. However, mscoree.dll could not be loaded to display the appropriate error message. Please reinstall the .NEt Frameword.
I just installed a .NET Framework on that computer.. don't know why i can't run the exe
Is it because the OS is to old or I have miss something.
I use Microsoft Visual Studio 2005 in this application
Can someone suggest what happened here...
but the program runs fine in Windows XP
Thanks... 
|
|
|
|
|
A .NET app typically requires the presence of a specific .NET Framework version, not just any version. And not all versions are compatible with Windows 2000, see e.g. here[^]
|
|
|
|