|
really switch it to false.
or add while(true){... code ...}
and it will run forever. a good trick eh Mom
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Please I need the code to access the main thread or at least a pointer. get it.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Check my reply to your TreeView question.
|
|
|
|
|
thanks
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
There is an Array.Sort() function that sort one dimensional array. How can I sort two dimensional based one of dimensions?
Mazy
No sig. available now.
|
|
|
|
|
yeah extend the class and write your own algorithm for it. Arrays in .NET suck, they should have grabbed some more java ideas
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
How can I get the KeyDown event to fire for the arrow keys?
|
|
|
|
|
you have to override the IsInputKey method, so that it returns true with the key arrows.
protected override bool IsInputKey(Keys key)
{
if (key.KeyCode == Keys.Up) return true;
else if (key.KeyCode == Keys.Down) return true;
else if (key.KeyCode == Keys.Left) return true;
else if (key.KeyCode == Keys.Right) return true;
else return base.IsInputKey(key);
}
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
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.
|
|
|
|