|
I have created a user control that encapsulates a DataGrid. The DataGrid contains some inherited visual column styles that allow for editing in a custom textbox, combocbox, etc. The DataGrid is bound to a dynamically created DataTable. The trouble is: When I Tab from column to column, it steps through one and into the next. When I set a breakpoint anywhere, it behaves itself.
I suspect this is a threading problem. Any Ideas???
Thanx
Greg
|
|
|
|
|
hiiii
i want that somebody give me code to get the RGB values from an image and show in edit boxes.
its a bit urgent plz
regards
tahir
|
|
|
|
|
What you can do is use the Bitmap class GetPixel method to get the Color of that pixel, then use the Color class R, G, and B properties to get the values you want.
Dim MyImage As New Bitmap("C:\testimage.jpg")
Dim pixelColor As Color = MyImage.GetPixel(0,0)
Dim r As Byte = pixelColor.R
Dim b As Byte = pixelColor.B
Dim g As Byte = pixelColor.G
RageInTheMachine9532
|
|
|
|
|
Hi,
I have an array with emailaddresses that I have extracted from a file in an import function in my program. But the same e-mail adddress may occurre several times in the array if the user did add it several times in the file.
I need a way to delete duplicates and I need help. What I want is to replace an address (it will vary) with an emty string("") or a string I can later use for testing against(lest say the string "duplicate" is the replacement). I am having trouble with my loop or if. The inner if sentence does not work. I have put the e-mail addresses also in a second array called tab, and checks each value in the first array against each value in the second one. Any suggestions? This is what I have:
Dim K as integer=0<br />
Dim L as integer=0<br />
For Each email In emails<br />
For Each em In emails2 <br />
If K <> L 'if it is a duplicate <br />
If emails(L).ToLower().Equals(emails2.ToLower())then <br />
emails(K)="duplicate" End If<br />
End If<br />
L = L + 1<br />
Next<br />
K = K + 1<br />
'MsgBox(emails(K)) 'only shows the value of the last element in the array. Next
IF anyone have a solution for how to do this, or another suggestion for a solution using for example RegEx I would really appreciate it
|
|
|
|
|
Try this logic
private void Email()
{
string[] emails = new string[]{"a@a.c", "a@a.c", "b@a.c", "b@a.c",
"a@a.c", "a@a.c", "b@a.c", "b@a.c"};
int j = 0;
for(int i = 0; i < emails.Length; i++)
{
for (j = i + 1; j < emails.Length; j++)
{
if (! emails[i].Equals("duplicate")
&& emails[i].Equals(emails[j]))
{
emails[j] = "duplicate";
}
}
}
string mbStr = "";
foreach (string str in emails)
{
if (! str.Equals("duplicate"))
{
mbStr = mbStr + str + ", ";
}
}
MessageBox.Show(mbStr);
}
|
|
|
|
|
Hi, and thanks for your help.
However I ended up trying out the StringDictionary like Ian suggested and I he opened a world of 'unknown' collections for me.
The code written by using a StringDictionary collection is shorter, so I'll stick with that for now. But I'll keep your code be cause I will probably need it some other time.
Thanks from Inger
|
|
|
|
|
|
Hi, and thanks for the advise.
I do not know what I am doing wrong in vb when it comes to arrays, but things that easily works with arrays in C++ or Java I can not make to work in VB6 or VB.NET..
However, I am now putting only unique emailaddresses in a StringDictionary thanks to your advise.
If anybody knows how I can add strings directly to the StringDictionary collection without extracting them first to a MatchCollection, I would appr. it. I think it should be possible to use the class Match and a method called findNext or something like that. It may reduce the overhead of having data added first in one collection, and then into an other.
This is the code:
Private Function ExtractEmailAddressesFromString2(ByVal source As String) As StringDictionary<br />
Dim mc As MatchCollection<br />
Dim i As Integer<br />
Dim myCol As New StringDictionary<br />
Dim m As String<br />
' expression from www.regexlib.com extracting email-addresses<br />
mc = Regex.Matches(source, "([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})") <br />
<br />
For i = 0 To mc.Count - 1<br />
'if address is not in collection from before, it is added <br />
If myCol.ContainsKey(mc(i).Value )=False Then <br />
myCol.Add(mc(i).Value, "") 'key + value <br />
End If<br />
Next <br />
Return myCol<br />
End function
|
|
|
|
|
Hey All
Does anyone know how to capture or record the screen into an AVI file through VB? I work in a call centre and for training purpose would like to capture the agents movements while on a call...
Any help would be great!
Later
|
|
|
|
|
Why write the code? Why not just use the Windows Media Encoder (free from here[^]) and record everything you do on the screen into an AVI?
RageInTheMachine9532
|
|
|
|
|
I need to code this because our software is connected to the PBX, so when a call comes in I would like to capture what the agent does on his/her screen. This will enhance our ability to maintain standards.
Any ideas??
|
|
|
|
|
Sounds like a very specialized app. You'll still need the Media 9 SDK and/or the Capture 9 Series tools to accomplish this, both come with code examples. The main problems you are going to have are storage requirements for the AVI's and a performance hit on the capture if the machine is not fast enough to do it AND perform the normal support functions at the same time. Capturing audio and video requires more than a little bit of CPU horsepower and the capture can fall behind and get jumpy if the machine is busy doing other things like loading Word, Excel, ... I would recommend testing the performance of such a setup by using the normal capture tools to see if the performance is acceptable before writing any code.
http://www.microsoft.com/windows/windowsmedia/download/default.asp[^]
RageInTheMachine9532
|
|
|
|
|
Thanks Dave for the quick responses.
I understand the problem I will face with resources but this would only be installed on new agents p.c's. This would help us to see how he/she is performing... I would only have to capture the video side of things because I already have a datavoice which captures all incoming and outgoing calls. Just incase of any problems.
Anyway thanks for you help
Later
|
|
|
|
|
I did timeworked in a call center for a while. The manager asked me to write an app that scanned the task list of the workstation for applications being run that were not part of the regular apps needed to do thier work and then report it back as an alarm to the manager.
Grrrrr.... but it ended up paying me so....
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
I created a simple database with 3 fields in it. When i tried to access it through VB.NET it says unknown data and will not let me go any further. any information on how to correct this problem would be appreciated. Thank you
|
|
|
|
|
You'll have to describe HOW your trying to access the database before anyone can tell you what's going on. Without seeing the code your using, it's near impossile to give you an accurate answer.
RageInTheMachine9532
|
|
|
|
|
sorry about that. I make the connection with jet 4.0 and i use a data adapter and im still good but when i try to generate the dataset it throws an error. The problem only happens when i try to access databases that i have created. When i use a database from example code it works fine. It must be something in the formatting of the database.
|
|
|
|
|
What's the error? What does the code look like? What line is the error on?
Details! Lots of details!
RageInTheMachine9532
|
|
|
|
|
Hi Guys can you help me with this:
1. How can I create an on-the-fly documentation generation for my codes so that when i compile my application the documentation is written in an html file?
2. How can i create my own description of the method i defined in my class such that when i call this method a TOOLTIP will come out exposing the Description i wrote for that particular method. Just like the members of any class in any assembly. When you press period (.) the members will come out and a tooltip will be displayed categorically showing the signature, return type and purpose for this method. Tnx a lot!
|
|
|
|
|
By default, the current version of VB.NET does not support this. You'll either have to write the .XML documentation file yourself or use a third party tool like the VBCommentor PowerToy, found here[^] at GotDotNet.
RageInTheMachine9532
|
|
|
|
|
The description i wrote didn't come out as part of tooltip when the intellisense was invoke. I installed VBCommenter 1.1.1 and activate the xml everytime i build my project under Options menu. I was able to add some comment/description thru the " ''' " but when i called the method its not coming out although it created an .xml file. Am i missing something maybe some sort of configuration so that it will come out once intellisense is invoke? Tnx!
|
|
|
|
|
I've never used it myself, but after looking thru the Forums on the GotDotNet.com site under VBCommentor, it looks like your won't see anything in Intellisense until the .DLL that is built is referenced in another project. You won't see anything in the current project...
RageInTheMachine9532
|
|
|
|
|
Is something wrong or is this OK. If I add two variables with a data type of single and like (845.12 + 312.14) and sent this directly to a text property of a label the display shows 1157.26. But if I store the sum into a variable with a data type of Double then display, it shows
1157.26000976563. Am I not allowed to convert a single to a double?
|
|
|
|
|
You are allowed to do this, but because of representation differences, you'll get results like these. The best way to do this is to use consistant data types. If the results of your calculations are requiring doubles, then use doubles for all the operands involved, not singles.
This is directly from the VS.NET 2003 documentation:
A conversion from a value type stores a copy of the source value in the destination of the conversion. However, this copy is not an exact image of the source value. The destination data type stores values differently, and even the value being represented might change, depending on the kind of conversion being performed.
RageInTheMachine9532
|
|
|
|
|
The problem is that I am pulling data from Microsoft Access. No matter what data type I use in Access I can only place that data in a Single data type within VB.
I used a little cheatiing by multiplying the return value by 100 and then transfering to a double and then deviding by 100.
This if fine if the data in Access is currency but other data would just have to only be transfered to a VB single data type.
|
|
|
|