|
Hi there,
What's the best approach to convert a 32byte Char[] Unicode array to
a simple string?
char Name[0]
char Name[1]
char Name[2]
...
char Name[31]
thanks for your help,
stonee
|
|
|
|
|
System.Text.Encoding.Unicode.GetString()
<a TITLE="See my user info" href=http:
|
|
|
|
|
How about this:
string mystring = new string(Name);
just create a new instance of a string using constructor that accepts array as an argument.
|
|
|
|
|
sure, thanks for that!
stonee
|
|
|
|
|
I am building my wrapper classes for CheckBox, ComboBox, Text, Radio, and a couple of others that do not come to mind at the moment. The goal is a disabled control without disabling them. I would like to have them be in a dead state as far as input goes (mouse, keyboard or pasting view clipboard) without them having the appearance of disabled controls. Would be great if the user could select the controls to copy text from or things like that, but absolutely, no changing any data or state until I set a flag.
Basically, I want to lock the controls until a user selects an option to edit.
Anything thoughts?
I thought of overriding the OnGetFocus or OnEnter, but they do not cover every situation.
Rocky Moore <><
|
|
|
|
|
Override TextChanged, Clicked, MouseDown etc. or their properties: Text, etc.
May be it helps.
Hi,
AW
|
|
|
|
|
A.Wegierski wrote:
Override TextChanged, Clicked, MouseDown etc. or their properties: Text, etc.
May be it helps.
Yeah, I was trying to avoid that. Most the items don't even respond until it is too late. Figure I will have to block down in the message pump to avoid any changes.
Rocky Moore <><
|
|
|
|
|
You could try createing a user control from each of them. Inherit from say a textbox and then override the WndProc function. I think that all windows messages go through here. I used it with the toolbar user control I made. You can't override the OnPaint for the toolbar because .net doesn't call it, it is drawn by the OS. I handled the paint message and a couple others from there. It will let you consume the ones you want and pass through the unwanted ones.
|
|
|
|
|
Anyone got any reccomendations for help creation software to work alongside c# ? Cost is a major issue on this one .
Am I the only one forever playing catch up with technology , while all the juicy opportunites keep rolling by ?
|
|
|
|
|
|
NDoc is great for generating documentation that can also serve as help. Try it out, you can make your documentation look exactly the same as how MSDN .NET documentation looks.
To make this all work, you have to use so called XML comments in your code and then you compile your code, /doc switch must be used to generate xml file that NDoc will use. somefilename.xml is just a file that you choose. I have a short article about this at: http://vbxzone.tripod.com/dotnet/dotnet06032.html
check it out.
|
|
|
|
|
I have a stream that I want to change before I bind it to a
richtextbox.
I don't want to save the stream.
It seems that I have to save it other ways I cannot bind
it to the textbox.
Example :
//Read template Form
FileStream fsTemp = new FileStream
@"c:\..\TemplateLayout.rtf", FileMode.Open,
FileAccess.Read);
StreamReader srTemp = new StreamReader(fsTemp);
string strTemp = srTemp.ReadToEnd();
strTemp = Regex.Replace(strTemp, "Number", base.Number);
string strFileOut = @"c:\..\Layout.rtf" ;
FileStream FileOut = new FileStream(strFileOut,
FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter w1 = new StreamWriter(FileOut);
w1.WriteLine(strTemp);
w1.Close();
base.TxT01.LoadFile
(@"c:\..\Layout.rtf",RichTextBoxStreamType.RichText);
How can I do the same thing without saving the stream?
Thanks,
x
.
|
|
|
|
|
Use a MemoryStream instead of a FileStream and load the STREAM directly into the RichTextBox
<a TITLE="See my user info" href=http:
|
|
|
|
|
Thanks Leppie.
Is it possible to have an example. I don't know how to do replacement in a memorystream neither how to bind this memeorystream to the richtextbox.
Thanks in advance,
x
|
|
|
|
|
Does anyone else think that the implementation of Windows.Forms has been compromised by the decision to continue to drive windows in a Single Threaded Apartment?
Does anyone know of a wrapper implementation that gives the seamless illusion that a window is 100% free threaded? I'm getting tired of calling Invoke(..) -- or having a refresh timer on a dialog to pull data off the back-end! There must be a better way!
Jade Burton
Programmer
|
|
|
|
|
You are not alone man. I haven't found an alternative either.
|
|
|
|
|
It's impossible, I think. Microsft use Invoke or timers in many controls (see variable names "delayed" in debugger!!!). Now I'm working on implementing FreeForm in DataGrid. I have no any timer or Invoke but it doesn't work good.
Hi,
AW
|
|
|
|
|
My app CPQ was running in systray and all of my sudden it crashed this info.
At the time of the crash I was doing some other work.
.NET-BroadcastEventWindow.1.0.3300.0.19:CodeProjectQuoter.exe - Application Error<br />
The instruction at "0x77f8b812" referenced memory at "0x04e40030". The memory could not be "read".<br />
<br />
Click on OK to terminate the program.
Can anyone explain me what's this error means?
"If Sun and [Microsoft] disagree on [language extensions to Java] and diverge in these areas, as long as Netscape doesn't buddy up with Sun, super outcome for us (more fragmentation)."
Ben Slivka, Microsoft engineer, October 1996
This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
Can anyone explain me what's this error means?
No, , its usually a threading/delegate/callback error. I havent look at your code, so I cant point any fingers
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
its usually a threading/delegate/callback error.
Had it been happened during the debugging then I could have catched it. But suddenly crashed, so I have no clue how it happened or which code made it crashed. I tried 2 or 3 times to bebug the app, but that error didn't throw up. Argh!!!
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
Had it been happened during the debugging then I could have catched it.
Nope, those errors are not caught by the debugger (maybe if unmanaged debugging is turned?).
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
unmanaged debugging is turned?).
It was false. I changed to "true", let me see if I can reproduce the error.
BTW, IIRC the only unmanaged code in my app is the code I borrowed from Marc (Single Instance)
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
|
Can I use the RowFilter of a DataView to populate it with only the enteries in the specified coloum that start with a certian letter?
tia
|
|
|
|
|
gadgetfbi wrote:
Can I use the RowFilter of a DataView to populate it with only the enteries in the specified coloum that start with a certian letter?
Confused by the statement. The "in the specified column that starts with". The column starts with a certian letter or the data in the column starts with a certain letter?
If it is the latter and you only want to filter the rows by a given column that has data starting with a certian letter you would:
myDataView.RowFilter = "substring(myColumn,1,1)='B'"
Where myColumn is the column you wish to filter by and 'B' is the letter you wish to match.
Rocky Moore <><
|
|
|
|