|
Do a for each compare and copy the dodgy item to listbox3
|
|
|
|
|
daveauld, thank you for your immediate response, can you give me a sample code for your suggestion?
Here is what my current code looks like:
Private Sub btnOpenCSV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenCSV.Click
ofdOpenCSV.Filter = "All CSV Files|*.csv;"
If ofdOpenCSV.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim strPathString As String
Dim strTestString As String = ""
Dim strArrString As String()
Dim strCSVRollNumber, strCSVRFIDNumber As String
strPathString = ofdOpenCSV.FileName.ToString
Dim myStream As System.IO.StreamReader
myStream = File.OpenText(strPathString)
Try
While myStream.Peek() <> -1
strTestString = myStream.ReadLine()
strArrString = strTestString.Split(",")
lstCSVListBox.Items.Add(strArrString(0).ToString & " :: " & strArrString(1).ToString)
End While
Catch ex As Exception
End Try
btnOpenCSV.Enabled = False
lblCSVSuccesful.Text = "File has been loaded."
End If
End Sub
Private Sub btnOpenAPI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenAPI.Click
ofdOpenAPI.Filter = "All CSV Files|*.csv;"
If ofdOpenAPI.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim strPathString As String
Dim strArrString As String()
Dim strTestString As String = ""
Dim strAPIRollNumber, strAPIRFIDNumber As String
strPathString = ofdOpenAPI.FileName.ToString
Dim myStream As System.IO.StreamReader
myStream = File.OpenText(strPathString)
Try
While myStream.Peek() <> -1
strTestString = myStream.ReadLine()
strArrString = strTestString.Split(",")
strAPIRollNumber = strArrString(1).ToString
strAPIRFIDNumber = strArrString(2).ToString
lstAPIListBox.Items.Add(strArrString(0).ToString & " :: " & strArrString(1).ToString)
End While
Catch ex As Exception
End Try
btnOpenAPI.Enabled = False
lblAPISuccesful.Text = "File has been loaded."
End If
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
'WHAT SHOULD I PUT HERE?
End Sub
Thanks again!
|
|
|
|
|
I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.)
I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following:
1. Put the column headers on to the top of each data column.
2. How to put report headers on the first 3 rows of each spreadsheet,
3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound.
Thanks!
|
|
|
|
|
i am working on project which i developed for long time,
recently someone out in germany wanted to use my application,
so i made a few tests on my application on germany set regional info in windows )
then i found out they use a comma decimal separator which pretty much killed my application.
i never thought of that before , i have done some reading on the subject and a lot of people like the idea of CultureInfo.InvariantCulture. in every parsing or to string method in the application , how ever the project contains kazzillion lines of codes,
and i rather shoot my self then doing that.
i was looking for a way to set the, cultureinfo to en-us in the application level ,
found this example which didnt work for me:
<br />
CultureInfo myCulture = new CultureInfo("en-US");<br />
myCulture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy";<br />
Application.CurrentCulture = myCulture;<br />
also found that i can change it on a thread level which doesn't really help me.
please anyone with any tips or answer to how i can change the culture in application level , or any other alternative i would like to here , it would me alot thanks in advance!!!!!!!
Net
|
|
|
|
|
Hi,
AFAIK there is no way to fix the culture info for an entire app, you can only set it on the thread level using Application.CurrentCulture or Thread.CurrentCulture. And there not being a way is an indication you are not expected to need it either...
Here are some guidelines:
- you should not fix the culture info on input/output intended for human consumption; the user chooses the culture through the Regional Settings control panel and all the apps should obey that choice.
- you should fix the culture info for culture-invariant data storage such as databases, allowing international cooperation on such data. ISO 8601 sets the standard for these.
- Since threads can be involved in both human I/O and database I/O you can't possibly have it all automatically. Hence the suggestion to keep the threads at the regional settings, so human I/O is fine, and explicitly code for culture-invariant I/O where appropriate.
FWIW: object orientation should prevent any detail to appear a kazzillion times whatever the size of the app is.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I basicly have the same problem:
I was trying to set the CurrentCulture of my application to en-US. I used the following source code:
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;
My solution consists in a HMI interface and a dll project. in the runtime mode, the HMI interface is set to en-US (had a label choing it each 1 second for test) but when executing things in the DLL project, I noticied that the CurrentCulture is getting back to fr-FR.
I read on the net that when creating threads, we have to change their CurrentCulture too but I'm not creating Threads. In other hands, I'm using delegates for the callbacks. Could they be the source of that?
For now, I'm forcing that by adding the 2 lines at the beginning of the procedure I'm using to get numeric input (which are using "." as separation). But this solution is not the best solution I guess.
Could anyone help me please?
|
|
|
|
|
You might not be creating threads explicitly and still be using threads, e.g. through the BackgroundWorker class or the ThreadPool class. And most asynchronous operations implicitly rely on the ThreadPool class, see my little article here[^].
Anyway, my previous reply remains valid. The only way out that I know of is by having each thread that works for you and needs your culture setting, to start with its culture getting set. Which means you might need that in your DataReceived handler of your serial port, and all the other asynchronous handlers you might have.
BTW: assuming changing the culture takes some time, you'd better add some flags so it gets set only once per thread.
|
|
|
|
|
Can you tell me how to Stop Resizing the VBAccelerator’s sGrid2 http://www.vbaccelerator.com/home/VB/Code/Controls/S_Grid_2/index.asp[^] Header when Column Width is out of range of Max width or Min Width?
When reaching the boundary of Max or Min Column Width, mouse don’t allow to move further to over the limits. I am trying to sendMessage when reach the end point but doesn’t work.
I can’t use bHandled = True when reaching the boundary, it will cancel the resizing action. I want to STOP resizing and mouse don’t allow to move further when reaching the boundary.
If lHDI(1) < m_lMinWidth(tHDN.iItem) And Not m_lMinWidth(tHDN.iItem) = -1 Then
lReturn = 1
bHandled = True
End If
If lHDI(1) > m_lMaxWidth(tHDN.iItem) And Not m_lMaxWidth(tHDN.iItem) = -1 Then
lReturn = 1
bHandled = True
End If
RaiseEvent StartColumnWidthChange(tHDN.iItem, lHDI(1), bCancel)
If bCancel Then
lReturn = 1
bHandled = True
End If
Here are the sGrid2 clsHeaderControl Subclass Code:
Private Sub myWndProc(ByVal bBefore As Boolean, _
ByRef bHandled As Boolean, _
ByRef lReturn As Long, _
ByVal lng_hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long, _
ByRef lParamUser As Long)
Dim tNMH As NMHDR
Dim tHDN As NMHEADER
Dim lHDI() As Long
Dim bCancel As Boolean
Dim bForceManualDragDrop As Boolean
Dim sFilter As String
Dim sx As Single
Dim sy As Single
Dim tP As POINTAPI
Dim tGRedraw As NMLVCUSTOMDRAW
Select Case lParamUser
Case exParentWindows
Select Case uMsg
Case &H4E 'WM_NOTIFY
CopyMemory tNMH, ByVal lParam, LenB(tNMH)
Select Case tNMH.code
Case HDN_BEGINTRACKA, HDN_BEGINTRACKW
CopyMemory tHDN, ByVal lParam, Len(tHDN)
'
|
|
|
|
|
|
When I am dragging a column divider,sysheader32 will issue HDN_TRACK Notification.But the interval of this notification (column width changing) is not by 1 pixels step . How to get notification by 1 pixel changing?
I want to implement ColMaxWidth and ColMinWidth property into vbaccelerator’s sGrid2.
When I am dragging the divider of a column, the column will stop resizing when column width is reaching the colmaxwidth or colminwidth boundary.
I am checking the mouse position or lWidth in sub m_cHeader_ColumnWidthChanging,if Column Width is reaching the colmaxwidth or colminwidth boundary,then I use ClipCursor API to restrict mouse movement. But the problem is that Header's HDN_TRACK notification is not being sent by 1 pixes change . When I got the notification,the column width has been changed by more than 1 pixels.That is why I can't control the column width accurately. e.g. the Max. Column width is set to 100,The min. Column Width is 50,But somehow,the Column width is going to 48 or 102,not the exact 50 or 100 while resizing.
in Header Class,I am Subclassing those related notifications:
Case HDN_TRACKA, HDN_TRACKW
CopyMemory tHDN, ByVal lParam, LenB(tHDN)
'/* Get HD_ITEM from tHDN.lPtrHDItem. Don't use a HD_ITEM
'/* structure - you will crash...
'
Private Sub m_cHeader_ColumnWidthChanging(ByVal lColumn As Long, _
lWidth As Long, _
bCancel As Boolean)
Dim iCol As Long
Dim iIntCol As Long
Dim tR As RECT
Dim tClipRect As RECT
Dim iCurrentCol As Long
For iCol = 1 To m_iCols
If (m_tCols(iCol).lHeaderColIndex = lColumn + 1) Then
iCurrentCol = iCol
End If
Next
If Not m_tCols(iCurrentCol).lMaxWidth = -1 Then
If lWidth > m_tCols(iCurrentCol).lMaxWidth Then
ClipCursorRect tClipRect
End If
End If
If Not m_tCols(iCurrentCol).lMinWidth = -1 Then
If lWidth < m_tCols(iCurrentCol).lMinWidth Then
ClipCursorRect tClipRect
End If
End If
pGetDragImageRect lColumn, lWidth, tR, False
DrawDragImage tR, False, False
RaiseEvent ColumnWidthChanging(lColumn, lWidth, bCancel)
If bCancel Then
DrawDragImage tR, False, True
End If
End Sub
Private Sub pGerClipColRect(ByVal lCol As Long, _
ByVal lMaxWidth As Long, _
ByVal lMinWidth As Long, _
ByRef tR As RECT)
Dim iCol As Long
Dim iGCol As Long
Dim tP As POINTAPI
'/* Find RECT for header column with Max and Min Width to stop sizing when out of boundary:
If lCol > 0 Then
'
[Chinese]当拖动Header的分界线时候,会发出HDN_TRACK消息(Notification)。问题是HDN_TRACK消息的发出间隔不是1 pixels by 1 pixels,可能多过一个Pixels.请问要用什么办法可以获得sysheader32的Column每改变1 pixels消息?
|
|
|
|
|
mates,
how to read the name of a public class.
example.
Public Class frmEntry
i want to put the name frmEntry in my log.txt using log4net.
in log.txt.
what i did in c#.net
private void Page_Load(object sender, System.EventArgs e)
{
log.debug(typeof(frmEntry) +"【Page_Load】*************[Start]")
}
what is equivalent in vb.net
Private Sub frmEntry_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
log.debug(Me.ToString & "【frmEntry_Load】*************[Start]")
EndSub
typeof(frmEntry) in vb.net???? TypeOf(Me) will not work.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
C#Coudou wrote: typeof(frmEntry)
GetType(frmEntry).ToString
|
|
|
|
|
Hi all
I'm new here and new to VB.Net 2008, so forgive my naivety...
I am trying to read the contents of .cbr and .cbz files.
Searching the net I have found UnRARdll.exe but when I try to add the reference in Visual Studio 2008 (VB) it won't accept the DLL as a valid reference.
Any ideas on what I am doing wrong or what I should be using?
I have also ssen the declaration 'imports RARNET' but I can't work out how to find the reference either.
Any help much appreciated. Many thanks in advance...
|
|
|
|
|
You can only set a reference to a .NET or COM-based .DLL. Since the reference won't go, you're trying to set one on a normal library .DLL. The only way to get at the functions of a library .DLL is to use P/Invoke. But, in order to do that, you need the documentation on the functions in the .DLL. Wihtout it, you're just guessing at the parameters you have to setup for each function.
|
|
|
|
|
Dave, many thanks I'll try a work around...
|
|
|
|
|
Hi group,
I have a tree view with eg. following nodes
# People
|
+--# Custumers
|
+-- # Anne Charles, Hillroad 14, 7766 MyTown, My Country
|
+-- # Steve Jones, Forestroad 12, 7766 MyTown, My Country
With the command
Me.treeViewM.Nodes(0).Nodes(0).Nodes(0).EnsureVisible()
I can ensure that "Anne Charles" is visible within the treeview. My problem is: If the treeview is not wide enough to show the complete node text of this node, the horizontal scroll bar is automatically moved to the right so that node structure shown left from the "A" in the text "Anne Charles" is not visible any more. Thus
Anne Charles, Hillroad 14, 7766 MyTown, My Country
Steve Jones, Forestroad 12, 7766 MyTown, My Country
is visible and the node structure is hidden.
Question: How can I ensure that the node "Anne Charles" is visible and also the horizontal scrollbar is aligned to the left, which means that the node structure left from the text is still visible?
Best wishes
Michael
[Visual Basic .net 2005]
|
|
|
|
|
Take a look at this[^]. One of the responses claims to do the trick. Unfortunately the code is C#, but have a look, you may be able to convert it yourself, but if not I'm sure that someone here will be able to help you out.
I have also found this snippet:
SendMessage(treeView.Handle, WM_HSCROLL, SB_LEFT, 0);
This also uses the Windows API, I don't think it is possible without doing that, but there's plenty on the web about the SendMessage API call, you will also need to look up the values for the WM_HSCROLL and SB_LEFT constants.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Wednesday, April 1, 2009 6:58 PM
|
|
|
|
|
thanks for your hints.
I've found the explanations on
[^]
It solved my problem.
best wishes
Michael
|
|
|
|
|
hi .... everybody
who can give me example of Database + listbox with image or icon
the icon and image within listbox can be checked by people and give the result of database query
garnett
|
|
|
|
|
If memory serves, QuickBooks used to use that technique.
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I can use VB.Net or C# .... just what I want
I now estimate the method
please don't post the reply answer of no help
garnett
|
|
|
|
|
This guy has posted the same request in more than one forum.
I have asked him to remove one, and explained the reasons that he should.
He appears not to want to.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I just want to know C# or VB.Net method
so I post to two forum
and plz don't waste time to reply unuseful answer
I only want to know the method that how to do it
garnett
|
|
|
|
|
I found the answer by myself, it uses component called "listbar"
I only want the answer like this , ok ?
garnett
|
|
|
|
|
Hi all,
i have vb.net dll and i used this dll from webbage, i want this dll to display message box through webpage to the client ans open new page contains textbox to get input from user.
please i want urgant help in this point.
Thanks
|
|
|
|
|