|
I can't as you fail to show a problem or a complete program.
There are several articles here about MaskedTextBox, maybe they can help you?
|
|
|
|
|
Please try using .AppendText .....
|
|
|
|
|
xbiplav wrote: MaskedTextBox1.Text+="1"
If you want to add the text at the beginning, how about
MaskedTextBox1.Text = "1" + MaskedTextBox1.Text
|
|
|
|
|
hello everybody!
I want to know about this above exception and why this exception occurs. If someone has experience with this exception, please tell me detail message about this.Now I can't find more information about this error code.Please help me.
phoopwint
flowerppk
|
|
|
|
|
Are you using a third party control, like Crystal Report Control?
I kept having this error when trying to display a Report. The report control was getting an error, it just doesn't
know how to report it to .NET. There was something wrong with my report. Once I got the report fixed, everything was fine.
|
|
|
|
|
Put it in a google search and see what happens.
phoopwint wrote: please tell me detail message about this.Now I can't find more information about this error code.Please help me.
You failed to supply any details of what you are doing and expect people to magically know what the error code is?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I want to create My Computer treeview like windows explorer in VB.Net. Would anyone help me ? Thank you very much.
|
|
|
|
|
Hello,
I need to sort in datagridview programmatically 2 columns, 'Main' Column and after 'Sub' Column.
The datagridview is unbound, I adding rows through datatable.
With DataGridView1
Dim IdxMainCol as integer=.Columns("Main").Index
Dim IdxSubCol as integer=.Columns("Sub").Index
.Sort(.Columns(IdxMainCol) & "," & (.Columns(IdxSubCol))
end With
Please help
Shay Noy
|
|
|
|
|
You can't concatenate DataGridViewColumn objects. The Sort method only takes a single DataGridViewColumn object, or a class that implements the IComparer interface.
Here's an example on using IComparer from MSDN Library:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
Handles Button1.Click
If RadioButton1.Checked = True Then
DataGridView1.Sort(New RowComparer(SortOrder.Ascending))
ElseIf RadioButton2.Checked = True Then
DataGridView1.Sort(New RowComparer(SortOrder.Descending))
End If
End Sub
Private Class RowComparer
Implements System.Collections.IComparer
Private sortOrderModifier As Integer = 1
Public Sub New(ByVal sortOrder As SortOrder)
If sortOrder = sortOrder.Descending Then
sortOrderModifier = -1
ElseIf sortOrder = sortOrder.Ascending Then
sortOrderModifier = 1
End If
End Sub
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements System.Collections.IComparer.Compare
Dim DataGridViewRow1 As DataGridViewRow = CType(x, DataGridViewRow)
Dim DataGridViewRow2 As DataGridViewRow = CType(y, DataGridViewRow)
' Try to sort based on the Last Name column.
Dim CompareResult As Integer = System.String.Compare( _
DataGridViewRow1.Cells(1).Value.ToString(), _
DataGridViewRow2.Cells(1).Value.ToString())
' If the Last Names are equal, sort based on the First Name.
If CompareResult = 0 Then
CompareResult = System.String.Compare( _
DataGridViewRow1.Cells(0).Value.ToString(), _
DataGridViewRow2.Cells(0).Value.ToString())
End If
Return CompareResult * sortOrderModifier
End Function
End Class
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thanks but I don't understand how it is related to my problem.
I have in my db:
MAINBOX | SUBBOX | 1 | 0001 | 1 | 0002 | 2 | 0001 | 2 | 0002 | 2 | 0003 |
...
I am displaying those 2 fields in datagridview. I would like to display them as described above -> First Sort by Main Box and then by Sub Box.
Please help,
Thanks
Shay Noy
|
|
|
|
|
shaynoy wrote: Thanks but I don't understand how it is related to my problem.
You showed how you tried to use the Sort method, and I showed you what to do to accomplish that.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I understand but what I need is to know if I can sort 2 columns as I showed before. Is it possible?
Thanks
Shay Noy
|
|
|
|
|
shaynoy wrote: I understand but what I need is to know if I can sort 2 columns as I showed before. Is it possible?
No, that is not possible. I already explained in the first reply that you can't concatenate DataGridViewColumn objects. You have to use an IComparer to sort on more than one column.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
ubderstood, thanks
Shay Noy
|
|
|
|
|
Dear Gents,
I have a text file call Imp.text containing the following contents in the same order
x1, x2, x3, x4
y1, y2, y3, y4
z1, z2, z3, z4
and I have 4 text boxes in a windows form.
My objective is I need to bind x1 into first text box, x2 into second text box, x3 into third text box etc.
When i press button named as next, it should display second row in the corresponding text boxes.. y1--> 1st textbox, y2---> 2nd text box etc..
I have written following coding but its always displaying the the last row only.
Dim i As Integer
Dim fields() As String
Dim filename As String = "C:\Inv\Imp.txt"
Dim delimiter As String = ","
Using parser As New FileIO.TextFieldParser(filename)
parser.SetDelimiters(delimiter)
While Not parser.EndOfData
For i = 0 To parser.EndOfData
fields = parser.ReadFields()
itemcode.Text = fields(0)
secondcode.Text = fields(1)
itemname.Text = fields(2)
category.Text = fields(3)
Next
End While
End Using
Pls correct me If I am wrong
Regards
Azeem
|
|
|
|
|
Ahamed Azeem wrote: "C:\Inv\Imp.txt"
Hard coding paths is a bad idea
I didn't know there was a textfieldparser class.
Ahamed Azeem wrote: While Not parser.EndOfData
For i = 0 To parser.EndOfData
Isn't this redundant ?
It seems to me that if your code works at all, it reads all three lines, and so ends up setting the fields three times before you'd even notice, leaving you with the last fields. Get rid of the while and the loop, and just read the fields once, and you'll get the first line, I reckon.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi guys,
In my windows form application, a user can store Items in a listbox. Each item is compiled from 4 textboxes. When the user clicks on another item, I need the contents of Item in the listbox to split and display in the textboxes.
Currently I am trying to use an arraylist. However, it think i need more than just an arraylist. I hope you are able to help.
Cheers.
|
|
|
|
|
this can be good solution:
you can specify new class that has 4 property for your 4 specifications
now you can get collection of Array list based on your class define above,
and at last you have an arryalist that have items corresponds with your special class.
i think you can implement this yourself but for implement details post here again.
Human knowlege belongs to the world
|
|
|
|
|
Hi, Thank you so much for the reply. I have done as you said. I have a class file which has 4 private variables declared, and then I have 4 properties for each.
The property code for each looks like this:
Public Property Artist() As String
Get
Return strArtist
End Get
Set(ByVal Value As String)
strArtist = Value
End Set
End Property
These are the steps I have taken:
In the Main form,
OnButtonClick
- Dim obj As New cls
- obj.Variable1 = Me.Textbox1.Text
- obj.Variable2 = Me.Textbox2.Text
- obj.Variable3 = Me.Textbox3.Text
- obj.Variable4 = Me.Textbox4.Text
- arrList.Add(obj) ???? Is this correct?
- Me.Listbox1.Items.Add(Textboxe1/2/3/4.Text)
THEN,
OnListBoxSelectIndexChanged
- I need to retrieve the values from the arraylist which at this point holds the class instance
- Then I need to put the data back into the original Textboxes. This is the part I am stuck at
Thanks in advance
|
|
|
|
|
Kindly assist me rectify VB 6.0 code below:
Shell("xcopy c:\Software\Zimbabwe c:\Program Files\Zimbabwe.* /-Y")
I want to copy the folder called Zimbabwe to Program Files but nothing seems to be happening.
|
|
|
|
|
i believe the problem is that shell assumes you know the location of xcopy. so by not specifying a path for xcopy it's looking at the local directory instead of c:\windows\system32, so put the path in for xcopy
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
The XCOPY command should be:
XCOPY C:\Software\Zimbabwe\*.* C:\Program Files\Zimbabwe\*.* /Y
|
|
|
|
|
Dave Kreskowiak wrote: XCOPY C:\Software\Zimbabwe\*.* C:\Program Files\Zimbabwe\*.* /Y
I tried this but still the results are negative. When I try this same command from the DOS prompt I get an error message that says: Invalid number of parameters. I think the problem could be on the spacing of the folder name Program Files but then how can this be rectified? Pease assist.
|
|
|
|
|
Whoops. Any path names with spaces in them should have quote marks around them.
XCOPY C:\Software\Zimbabwe\*.* "C:\Program Files\Zimbabwe\*.*" /Y
|
|
|
|
|
Hi..
ive read multiple articles through multiple location in google and somewhat understand what threading can do.. however..
how do i decide where and when my app will need it ???
for example.. the only place i can think of where my app will do heavy work is producing reports through dlgprintpreview.etc is that something i need to consider using threading for ..
any advice would be much appreciated.
Regards
Robbo
|
|
|
|