|
hi the re i'm wondering if any one cud tell me of an alternative for using system.xml.xpath & system.xml.xsl in the .NET CF (using C#.NET) as some of u might know both name spaces are not supported in the CF?!!
i'm trying to use this in smart device application:
XslTransform xslt = new XslTransform();
xslt.Load(stylesheet);
XPathDocument xpathdocument = new
XPathDocument(filename);
XmlTextWriter writer = new XmlTextWriter("result.html", null);
writer.Formatting=Formatting.Indented;
//
xslt.Transform(xpathdocument,null,writer);
regards
|
|
|
|
|
Hi!
I got the following problem:
I invoke from a dll a class which contains an array. I modify the array, but i can't set it back with the SetValue Function.
Here some code:
// Add an object to the array
object[] cNewArray = (object []) System.Array.CreateInstance(m_cCurrentObject.GetType(),cTmp.Length+1);
// Copy old values
cTmp.CopyTo(cNewArray,0);
// Set new value
cNewArray[cNewArray.Length-1]=cXmlSerializer.Deserialize(cReader);
// initial generated object, write the values back, m_cCurrentObject is a reference to the array member in the object obtained with the GetValue Function, Throws an System.ArgumentException. The SetValue Function accepts only object not object arrays.
m_cGenObject.GetType().GetField("identity_template").SetValue(m_cCurrentObject, oValue);
Thanks for your help.
53746F6E65
INT 19H
|
|
|
|
|
any ideas how we can retrieve REG_EXPAND_SZ value from registry? ex. when i insert it as %windir% and retrieve it it automatically expands it, how can i stop it from autoexpanding? i want the actual value not the expanded one.
|
|
|
|
|
How make validatin that whitespace are not allowed in textbox?
How i get the key code of press key?
|
|
|
|
|
There are two different things you can do:
1. Handle Validating event for the TextBox , and use regular expressions to validate that no spaces are in the string the user entered, and if yes, don't allow the user to go to another control before correcting it.
2. In the KeyDown event, if the key is a space, set e.Handled = true , so the TextBox doesn't handle it, effectively eating the keystroke.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
i tried using this but it does not work
i tried using this sample code.
private void textBox1_KeyDown(object sender,System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyValue==65)
{
e.Handled=true;
}
}
it still prints the character 'a' in the text box
|
|
|
|
|
tyutyutryryr
ghfgh
fghfghf
ghfgh
fgh
f
gh
fg
hf
gh
f
h
gfh
|
|
|
|
|
Hi...
I have an RichTextBox, and i want to make the textcolor/backgroundcolor diffrent from the other text, but it is not all the text wich should be diffrent... only some of it!
I have tried this...
int WordID = 5;
richTextBoxText.Select(0, WordID);
richTextBoxText.SelectionColor = System.Drawing.Color.Blue;
richTextBoxText.Select(0,0);
but if the richtextbox has scrollbars, it will go top of the text, and i do not want it to do that!
can anyone help me how to change the color, so it would not select the first char. but instead that char it was before the color changed!
Thanks
QzRz
|
|
|
|
|
Have you tried remembering the old location?
int oldIndex = richTextBoxText.SelectionStart;
int WordID = 5;
richTextBoxText.Select(0, WordID);
richTextBoxText.SelectionColor = System.Drawing.Color.Blue;
richTextBoxText.Select(oldIndex, 0);
|
|
|
|
|
thanks... it works now...
QzRz
|
|
|
|
|
In your code, you are using
richTextBoxText.Select(0,0);
which is making the cursor to go to the top of the text (i.e., the position of 0 with the selected length of 0, which means simply moving the cursor over there). Try removing this last line of code.
Otherwise, the method is very simple, first select the portion whose color is to be changed. And, then use the SelectionColor property. For example-
richTextBox.Select(5,15);
richTextBox.SelectionColor = Color.Blue;
These lines of code will change the color of the text starting at point 5 and with a length of 15 characters.
|
|
|
|
|
that is what I did first time, but then the text is marked, and that is what i wanted to get rid of!
QzRz
|
|
|
|
|
Hallo, here I am with onother strange question!
You may think: "he's full of questions..."
Now the problem is quite simple: I'm using an rtf textbox. If I change the font property all of the text assumes the new changes. How cna I change font name, size, style and color from the position the curso is without changing the font property of all the text?
Thanks
CometKeeper
|
|
|
|
|
The RichTextBox has several properties starting with Selection (e.g. SelectionColor ). If no selection is present those properties won't have any immidiate visible effect, but will do what you are trying to achieve.
|
|
|
|
|
How can I get results written by a console application in order to display on another application, a textbox, for instance?
|
|
|
|
|
you can use this:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
info.FileName = "CommandLineApplication.exe";
info.CreateNoWindow = true;
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
process.StartInfo = info;
process.Start();
to retrieve the results use process.StandardOutput.ReadToEnd(); or the other ReadX() methods
_______
http://www.jockersoft.altervista.org
|
|
|
|
|
I would like to display each line as the console app is running, the ReadLine method seems to work, but I recieved only one line, the ReadToEnd method waits until the console app ended to display its results.
Any suggestion?
|
|
|
|
|
Description
I'm trying to process a KeyPressed event on a form
sent to my user control. After the processing of
the event, I want to send the keystock to a textbox
on the form.
I can ,of course, access the text property of the
text box but I wanted to know how can I do it in
another way.
Question
How can I access the text box and give it the keystrock
as if it has the focus and I only pressed a key on the form.
I understand that when a form get a key, it looks for
the control with the focus and send him the key, or event.
How can I emulate that, so I can send a key after I processed
it, to other control or controls?
|
|
|
|
|
You'll need to use PInvoke and use SendMessage[^] to send the TextBox a WM_CHAR[^] message
[DllImport("User32.dll")]<br />
public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);<br />
<br />
public void SendTextBoxKeyPress()<br />
{<br />
SendMessage(textbox.Handle, 0x0102 , (int) Keys.Enter, 0);<br />
}
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
is it a fantasy?
If it is not possible how about getting the Width or X,Y coordinates of the notification area (systray) ?
|
|
|
|
|
You don't need to P/Invoke win32 APIs to get this to work. The NotifyIcon component provides a MouseDown and MouseUp event which you could handle, and that provides your X and Y coordinates through the MouseEventHandler . You could, in one example, cache the X and Y coordinates when the mouse is clicked down on the systray icon and when the Click event fires you can retrieve that. An example is shown below. You could also coordinate your own client event handler, but this requires extra code that would not be necessary.
notifyIcon1.MouseDown += new MouseEventHandler(notifyIcon1_MouseDown);
notifyIcon1.Click += new EventHandler(notifyIcon1_Click);
Point p;
private void notifyIcon1_MouseDown(object sender, MouseEventArgs e)
{
p = new Point(e.X, e.Y);
}
private void notifyIcon1_Click(object sender, EventArgs e)
{
MessageBox.Show(string.Format("The user clicked at {0} within the icon.", p));
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks Heath, that is nice. But what if the user does not click on the notifyicon? I need to know the location even if the icon is not clicked. Can I emulate/simulate a click?
I am also interested in finding a way to get the width and location of the entire systray (aka notification tray) area. I am trying to emulate the behavior of Windows Messenger when it is closed. You will see how it "animates" the close, thus showing the user that the window is actually being minimized to the systray.
Thanks again, Tom.
|
|
|
|
|
You'll need to register a hook into the Windows system message loop. Your application - without using a hook or some sort of inter-process communication (IPC) - will only receive events that occur within the main application or child windows (including controls, which are child windows).
See Global System Hooks in .NET[^] for a good article that describes how to register hooks and that includes sample code.
If you want to find articles on Messenger-style notification windows, search for "messenger[^]", for example, on this site. You'll find several good articles and sample code.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Use the hook to simulate a mouse click on the systray icon?
Or use a hook to get the width of the entire systray?. I read the article and cannot turn up how to do either of these tasks. Please advise. Thanks for your help so far.
|
|
|
|
|
From your previous post:But what if the user does not click on the notifyicon? I need to know the location even if the icon is not clicked. Can I emulate/simulate a click? The first two sentances do not agree with the concept of the third. The hook is to register yourself to receive notification when a user clicks outside of your client area. If you want to simulate a click, the easiest way is to simply call your Click event handler, or the method that contains the code you want done when a user clicks your icon.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|