|
Thanks, my life has been saved.
|
|
|
|
|
Hi!
Someone knows how can I implemment an History List in a TextBox?
Something where the User type a word and the control "remember" what the user has typed and shows a list (similar to comboBox) with phrases begining with the word he are writing.
If someone knows where I can get a sample or something, please help me!
Thnks in advance.
Best Regards
Robert
Sorry: My english is too poor
|
|
|
|
|
Search for auto-complete or auto-completion. Those words should get you to a sample that will help you out.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Yes that was exactly what Im looking for!
thanks
Robert
|
|
|
|
|
Hi, I have the following regex pattern declared:
private const string ParamPattern = @"(?<name>@\w+)='(?<value>.*?)'";
this is used to match all occurences of eg/ @myVar='myVal' in a string which may have multiple "params". The whole string often looks like:
somthing[@myVar1='myVal1'][@myVar2='myVal2']
so the above would find 2 matches using my regex. Here is my problem... if one of the variables has a single quote it gets cut off ie/
myTestVar='my apostrophe'd val'
the group called "value" in my regex only matches up to the apostrophe. I can easily replace 1 apostrophe with 2 so it becomes
myTestVar='my apostrophe''d val'
but I cant work out how to change my regex to ignore double apostrophes in the value group...any help appretiated.
|
|
|
|
|
Well, you could use zero-width assertions:
string s = @"myTestVar='my apostrophe''d val'";
Match m = Regex.Match(s, @"'(.*?)(?<!')'(?!')");
if (m.Success) Console.WriteLine(m.Groups[1].Value);
output: my apostrophe''d val
The (?<!') asserts that the character before the apostrophe (used in the match) is not an apostrophe. And the (?!') asserts that the character after is not an apostrophe.
|
|
|
|
|
Thank you for your help, I managed to fix this for now in a very simple way that I didnt think about yesterday!
I wrapped my current exp with \] and \[ so that it only matches the apostrophe if it weas next to a closing square brace.
|
|
|
|
|
You're probably out of luck, without using a slightly different approach. There are two ways for a regular expression to match things. Either take the smallest bit that matches, or take the largest string that matches. Either way, you'll end up with the wrong information, if your row looked like something[@myVar1='my apostrophe'd val'][@mayVar2='myVal2'] . The non-greedy search would find what you've already discovered, while the second would include both variables in the one string.
It is possible, with some work, that you could turn on the greedy string matching, and then modify the expression to never include '[' or ']' characters. But, I don't know enough about your setup to discern whether that would really be a viable option.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
How can i add to the window form title bar a button (with the point) to show the program on the system tray bar?
Thanks
|
|
|
|
|
Hello All! This is my first post, but I'm an avid reader..
I've been given a project to create a Tool to generate CHM files for all our subsystems. NDoc is used to create CHM files for each subsystem, but the problem is everytime you update the code or remodify it, you have to remember it and run Ndoc on that subsystem again. My job is to create a tool that will automatically (whenever run) run NDoc on all of the subsystems/files and create the CHM files.
I plan on using C# and creating a visual application.. but I'm not so sure how to start my attack on this. I know the StartProcess command and can easily load the program NDoc, but how would I pass it arguments in C# or load it with the arguements? I guess I'm not sure how to program a tool that uses an existing program..
curious if anyone has any insight or help? Any is appreciated!
|
|
|
|
|
Hi,
I've a problem when I want to save my image and reducing color number
I think that my bad parameter is the EncoderParameters
This is my code :
myImageCodecInfo = GetEncoderInfo("image/tiff");
// EncoderParameter object in the array.
myEncoderParameters = new EncoderParameters(1);
// Save the image with a color depth of 7 bits per pixel (128 colors).
myEncoderParameters.Param[0] = new EncoderParameter(Encoder.ColorDepth, 7);
picChart.Image.Save(rasterFileNameTif,myImageCodecInfo,myEncoderParameters);
But I've an exception :
System.ArgumentException: Invalid parameter used.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at displayRaster.displayRaster.ChangeRasterFormat() in c:\documents and settings\franck\mes documents\visual studio projects\displayraster\displayraster.cs:line 176
When I compile the only example that I found :
myEncoderParameters.Param[0] = new EncoderParameter(Encoder.ColorDepth, 24L);
It works with all files format (I have no exception...) but not with .tif file and I have this :
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at displayRaster.displayRaster.ChangeRasterFormat() in c:\documents and settings\franck\mes documents\visual studio projects\displayraster\displayraster.cs:line 176
So, I have some question :
Is somebody can explain to me how works the second parameter after ColorDepth (24L).
Alors, j'ai quelques petites questions :
To reduce color number to 128, it's corresponds to bpp (2^7 = 128)?
Thx for replies
Have a nice day
bibax n fait un max!
|
|
|
|
|
is there away to use the exit.sub in C#?
|
|
|
|
|
|
I'm writing test fixtures through NUnit for a program that is completely separate from my test code (I reference the dll's), and I keep running into the same error when I try to test a method that access a database or an XML doc. That error is, of course, the Null Reference Exception. However, the program that I'm testing works great when I run it live in the environment it's meant for (which is the internet, it's a ASP.NET/C# web app). Does anyone know how I might be able to solve this problem through my test code without changing the code that's being tested?
|
|
|
|
|
Hi,
I'm trying to implement the generic IEnumerator interface as part of a generic collection. It seems that the IEnumerator interface requires IDisposable implementation. Anyone know why? This doesn't seem to make any sense to me. Shouldn't it be my choice as designer as to whether i need to implement IDisposable?
The original IEnumerator require IDisposable.
Cheers
Jon
using System.Beer;
|
|
|
|
|
|
Hello,
I am beginning to write a custom combobox control. Right now it doesn't do anything special. I created a class that extends ComboBox:
public class TimeSelector : System.Windows.Forms.ComboBox
and in its constructor I call Populate:
public TimeSelector()
{
try
{
if(!DesignMode)
{
Populate();
}
}
catch(Exception ex_)
{
MessageBox.Show(ex_.Message);
}
}
where Populate is as follows:
private void Populate()
{
Items.Clear();
string[] times = new String[48];
DateTime dt = new DateTime(1,1,1,23,30,0,0);
for(int i = 0; i < 48; i++)
{
dt = dt.Add(new TimeSpan(0,30,0));
times[i] = dt.ToString("h:mm tt");
}
DataSource = times;
}
Now, when I run a form that contains this control, the combobox correctly contains all of the items that I populated it with. However, whenever I do anything to the control while I am looking at the form that contains it in design mode, it gets messed up.
Specifically, when I go back to look at InitializeComponent in the form's code, it seems to have added all of the times to the combobox thru a DataSource and then it manually adds each time to the combobox's Items collection right after that:
this.ts.DataSource = new string[] {
"12:00 AM",
"12:30 AM",
"1:00 AM",...
this.ts.Items.AddRange(new object[] {
"12:00 AM",
"12:30 AM",
"1:00 AM",...
This causes an error because you can't modify the combox's Items while it is data bound. And this happens no matter what I do while in design mode (if I move the control, set Enabled to false, whatever).
Can someone tell me what I am doing wrong?
Thanks,
-Flack
|
|
|
|
|
Hi all, I have a problem finding a way to hit test two regions. Found the
method IsVisible, but it doesn't work out well. Does somebody have a suggestion?
|
|
|
|
|
Hi!
Don't know if it will work, but you could try creating the intersection of the two regions (using Region.Intersect()) and then compare the result to an empty region (created with Region.MakeEmpty()).
Region.Equals is overloaded, so perhaps it will return true if you compare two empty regions.
If your two regions _do_ overlap, the intersection will not be empty and the comparison will return false. Otherwise, if your regions _don't_ overlap, you'll have an empty intersection and the comparison should return true.
I didn't try but it could work.
Regards,
mav
|
|
|
|
|
I've tried this, but the problem is that the overloaded Equals method requires a Graphics object. (Main problem is that I know very little about Graphics and Regions by the way). I can create a new Graphics object (from my parent form) using CreateGraphics, but this doesn't seem to work.
|
|
|
|
|
Hi
I want to do encryption with the .NET classes and then decrypt with a native c class to not be dependant on .NET on the decrypting side. For instance using dsCrypt available at:
http://freezip.cjb.net/freeware[^]
However I just cant manage to decode the message correctly, is just becomes junk. Has anyone expericance from doing a similar thing?
|
|
|
|
|
I am creating an application for a mobile device with pocket PC in C# manufacturer is Symbol . Can any body help me how can I get scanned barcode into my C# (windows) application .
Thanks
Learner always
|
|
|
|
|
hi
I want to save my database table contents in to CSV format using C# .
how can i do this.
This is very urgent plz reply ASAP.
Thanks in advance
Alok
|
|
|
|
|
A csv format replaces tabs with commas so if you can read your table then you can convert from datatable to csv as shown in following pseudo-code:
DataTable myTable = GetTableContents(tableName);<br />
StringBuilder sb = new StringBuilder();<br />
foreach (DataRow row in myTable.Rows){<br />
for (int colIndex = 0; colIndex < myTable.Columns.Count){<br />
if (colIndex != 0) sb.Append(",")<br />
sb.Append(row[colIndex].ToString());<br />
}<br />
sb.Append("\n");
}
|
|
|
|
|
Hi,
I'm new to .Net and very much need to know how I go about creating a server on a client PC that I can hook other applications into ?? I don't want to use remoting as its on the same client machine but I need to keep a stategull component that is instantiated by the first app to hook to it and avaialble to other apps to hook into ??
Thanks
Chubby..
|
|
|
|