|
I tried that, but when I put a breakpoint there, I see the function never gets called... hmm?
|
|
|
|
|
hmmm, it should do, it does when i create controls, are you creating a control from scratch? or adapting a current one?
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
To override the form or custom controls
<br />
protected override bool ProcessKeyPreview( ref System.Windows.Forms.Message mes )<br />
{<br />
Keys keyCode = (Keys)(int)mes.WParam & Keys.KeyCode; <br />
<br />
if((mes.Msg == WM_KEYDOWN || mes.Msg == WM_KEYUP) && keyCode == Keys.Down ) <br />
{<br />
MessageBox.Show("Arrow handled");<br />
return true;<br />
}<br />
else<br />
return false; <br />
<br />
}<br />
for other controls like a textbox
<br />
Form1_Load()<br />
this.myControl.KeyDown += new KeyEventHandler(this.MyKeyDownEvent);<br />
<br />
<br />
...<br />
<br />
<br />
private void MyKeyDownEvent( object sender, KeyEventArgs e )<br />
{<br />
if ( e.KeyCode == Keys.A )<br />
MessageBox.SHow("Hey you typed an AS");<br />
}<br />
there you go dude the above works for override the message loop for custom controls and the below works for controls inside your container.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Downt forget the defines, I dont know where they exist in c# so i just make them consts
private const int WM_KEYDOWN 0x100;
private const int WM_KEYUP 0x101;
your C++ include files have all the values inside the libraries.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Hello,
I have two tables, I wish to display the child table on the datagrid.. and a specific column from the parent table.. For example |column1|parentcolumn3|column2|
The child table is related to the parent table via parentID, but this is not the parent column I wish to display..it is parenteColumnXX
Can this be done on a dataGrid?? I do not want for the parent table to be displayed as a link neither I just want one specific parent column to be displayed in the same datagrid as the child table..
Hopefully I manage to explain the situation correctly..
And as always I really appreciate any help offered!!
Thank you!
|
|
|
|
|
why sure you could but you will need to create either a view to maintain this or extend the grids functionality for data binding. I would try the first, first.
You will need to create your own tablestyles collection
see this web page
|
|
|
|
|
why sure you could but you will need to create either a view to maintain this or extend the grids functionality for data binding. I would try the first, first.
You will need to create your own tablestyles collection
see this web page
Like, DUDE, it has all the answers man!
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
The error:
The action being performed on this control is being called from the wrong thread. You must marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.
Begin the delegate call:
<br />
private void Form_QueryOperation_Load(object sender, System.EventArgs e)<br />
{<br />
<br />
SampleSyncronized sampSyncObj = new SampleSyncronized();<br />
SampSyncSqrDelegate sampleDelegate = new SampSyncSqrDelegate(sampSyncObj.LoadTreeView);<br />
IAsyncResult aResult = sampleDelegate.BeginInvoke(tvOperation, null, null);<br />
<br />
aResult.AsyncWaitHandle.WaitOne();<br />
<br />
sampleDelegate.EndInvoke(aResult);<br />
<br />
<br />
}<br />
Updating class
<br />
[Synchronization()]<br />
public class SampleSyncronized : ContextBoundObject<br />
{<br />
public void LoadTreeView( System.Windows.Forms.TreeView crossTV )<br />
{<br />
LoadTreeViewNow(crossTV);<br />
}<br />
<br />
private void LoadTreeViewNow(System.Windows.Forms.TreeView tv)<br />
{<br />
<br />
add tree node codew here<br />
how do I catch the current main thread to update the trre view
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
In the LoadTreeView method, your code should call the LoadTreeViewNow method using a delegate and Invoke, in order to ensure the treeview is updated on it's creator's thread.
public delegate void LoadTreeViewHandler(System.Windows.Forms.TreeView tv);
[Synchronization()]
public class SampleSyncronized : ContextBoundObject
{
public void LoadTreeView( System.Windows.Forms.TreeView crossTV )
{
Invoke( new LoadTreeViewHandler(LoadTreeViewNow), new object[] { crossTV } );
}
private void LoadTreeViewNo (System.Windows.Forms.TreeView tv)
{
}
|
|
|
|
|
Hey Furty,
PLEASE HELP!!!!
Furty wrote:
Invoke( new LoadTreeViewHandler(LoadTreeViewNow), new object[] { crossTV } );
What namespace or object does the Invoke statement belong to, it doesn't recognize the command. Is this a reflection method?
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
please help sir
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Is it possible to make query from XML file with sort/filter option with XPath? Like ORDER BY/%LIKE% in sql language.
Mazy
No sig. available now.
|
|
|
|
|
I think it might be possible, check out XPathExpression.AddSort method. I've never used it, so I can be wrong.
- Kannan
|
|
|
|
|
Thanks Kannan, I'll check it.
Mazy
No sig. available now.
|
|
|
|
|
http://www.topxml.com/xsl/articles/xsl_ado/
look for Sorting
Will
|
|
|
|
|
Have a look at this:
public XPathNodeIterator SelectSorted(XmlNode node, XmlNamespaceManager namespacemanager)
{
XPathNavigator nav = node.CreateNavigator();
XPathExpression xpathExpr = nav.Compile("xpath_expression");
xpathExpr.SetContext(namespacemanager);
xpathExpr.AddSort("sort_expression", XmlSortOrder.Ascending, XmlCaseOrder.None, String.Empty, XmlDataType.Text);
return nav.Select(xpathExpr);
}
|
|
|
|
|
Thanks for your reply. How does xpath_expression or sort one look like? Like SQL?
Mazy
No sig. available now.
|
|
|
|
|
The sort expression is: (from MSDN in VS.NET)
An expression representing the sort key. This can be a string or
an XPathExpression object. The result of this expression is converted
to a string, according to the XPath specification, for comparison. In
an XSLT stylesheet, if xsl:sort is used, but no select expression is
specified, then string(.) is used by default. I just use a string with the elementname or atributename I will have it sorted by.
For the XPath expression bit, you should have a look at this quick introduction to XPath[^] from www.w3schools.com[^]
|
|
|
|
|
Hi!
I need to convert the web browser's notation of path with extra unicode characters (ie. "%20") to regular readable string. There are some converters in System.Text, but I've no idea how to use them.
Any ideas?
h.
|
|
|
|
|
System.Web.HttpUtility.UrlDecode("Encoded%20String");
that should do the trick.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
Whenever I declare an array I have to say how big it is... i.e. [7]...
Now, what if I don't know how big it needs to be...? How would I do that?
/\ |_ E X E GG
|
|
|
|
|
Some examples:
int[] i;
i=new int[]{0,1,2,3,4,5};
i=GetArray();
A good tutorial on arrays in C#[^]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thanks for the link.
/\ |_ E X E GG
|
|
|
|
|
here is an example.
using System.Collections;
...
array = new ArrayList();
int[] myArray = array.ToArray(typeof(int));
this example will turn the ArrayList object into an array of int objects, you can change the type of array returned by changing the parameter of the ToArray method.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|