|
Its not working - is there is other way ?
|
|
|
|
|
Could you use the is keyword?
if (_Variant is int)
{
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I am using Visual Studio 2003. I have to create an object of PrintDocument Class(in C#) at RunTime. But I'm not able to add.
When I am typing the following line, after the new word there is no Description provided for the PrintDocument() class.
PrintDocument printDocument1 = new PrintDocument();
How can I add this PrintDocument class's object at RunTime?
|
|
|
|
|
I have one API url ..
http://***.***.***.***:**/login/pushsms.php?login=ABC&pass=con***&mob_no=**********&text=*****
I have one table name tbl_promoter in this table one field is 'TL_name', 'TL_Mobile_number' and 'date' ....this table autometic update by listener.
i want to do send autometic sms on TL_mobile_number daily morning 10 AM with previous day status ...by api url...which is given above ...
mean i want......... how i will pass two parameter mobile number and text ...dynamic by sql table ....
Mukesh kumar Singh
|
|
|
|
|
Hi, i design Notepad with Forms (in Windows Application ) ,but How can I design Find Menu (in Edit Menu) with Forms?
Thank you for your attention.
Nazli
thank you nazli jahani
|
|
|
|
|
Here you can design just the form like the find window.....
Here you can also use the InputBox if you does not want to give extra facilities like Search Up, Down, Search Case Sansitive etc...
Naresh Patel
|
|
|
|
|
OR
If you don't like the appearance of default InputBox, you may create small form that can acks like Find dialog..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
|
Hi All,
I working on my treeView.
I had a treeView with both CheckBox and Expandlist.
I had a "NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)" method.
inside the method I wish to know whether I click on is a checkbox or the expand + button.
how can I do it?
|
|
|
|
|
Have a look at TreeView.HitTest() and in particular its Location property.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi thanks,
but tat don't do the trick. I felt.
my tree goes like this.
c:\
---a\
---b\
-----a\
-----b\
---c\
-----a\
-----b\
-------a\
-------b\
---d\
I nd to find out whether I click is a + sign or a check box. how to program it? thanks.
|
|
|
|
|
You can find list expanding using AfterExpand and BeforeExpands events and from the e argument you can find the affected node and action
and the same approach works for check boxes with using AfterCheck and BeforeCheck events
public Form1()
{
InitializeComponent();
this.treeView1.BeforeExpand += new TreeViewCancelEventHandler(treeView1_BeforeExpand);
this.treeView1.BeforeCheck += new TreeViewCancelEventHandler(treeView1_BeforeCheck);
}
void treeView1_BeforeCheck(object sender, TreeViewCancelEventArgs e)
{
StringBuilder str=new StringBuilder();
str.AppendFormat("[Check] Name: {0} CurrentStatus: {1} NextStatus: {2}",e.Node.Text,e.Node.Checked.ToString(),(!e.Node.Checked).ToString());
MessageBox.Show(str.ToString());
}
void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
StringBuilder str = new StringBuilder();
str.AppendFormat("[Expand] Name: {0} CurrentStatus: {1} NextStatus: {2}", e.Node.Text, e.Node.IsExpanded.ToString(), (!e.Node.IsExpanded).ToString());
MessageBox.Show(str.ToString());
}
good luck
|
|
|
|
|
I tink U don't get wat I mean
See.. when I click using the mouse.
it enter tv_local_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) method
In the method I wish to know whether I click on the check or click on the expand slot.
is there a way???
-- modified at 5:04 Tuesday 14th August, 2007
|
|
|
|
|
this.treeView1.BeforeExpand += new TreeViewCancelEventHandler(treeView1_BeforeExpand); associates method treeView1_BeforeExpand to this.treeView1.BeforeExpand event
and same thing for the next one
|
|
|
|
|
when you click on the node it's not going to expand or checked ,it's just clicked and for expanding them you must click on the + sign not the node so the click event would not be invoked but the BeforeExpand event would as beforeCheck event for checkboxes
So there is no way to find the check or expand with click event (I think your problem was here)
but with other four events I said before you can.
if you need them to call the same method with expanding-checking and clicking you can do this
public Form1()
{
InitializeComponent();
this.treeView1.BeforeExpand += new TreeViewCancelEventHandler(treeView1_comb);
this.treeView1.BeforeCheck += new TreeViewCancelEventHandler(treeView1_comb);
this.treeView1.Click += new EventHandler(treeView1_comb);
this.treeView1.BeforeCollapse += new TreeViewCancelEventHandler(treeView1_comb);
}
void treeView1_comb(object sender, EventArgs e)
{
if (e is TreeViewCancelEventArgs)
{
TreeViewCancelEventArgs te = e as TreeViewCancelEventArgs;
if (te.Action == TreeViewAction.Expand)
{
MessageBox.Show("On Expand");
}
else if (te.Action == TreeViewAction.Collapse)
{
MessageBox.Show("On Collapse");
}
else if (te.Action == TreeViewAction.ByKeyboard || te.Action == TreeViewAction.ByMouse)
{
MessageBox.Show("On Check");
}
}
else
{
MessageBox.Show("On Click");
}
}
as you see ,there is single method associated to four events for four different signals
and you can simply do this with After events ,just change TreeViewCancelEventArgs to
TreeViewEventArgs and associate after events instead of before events
hope this one Help
|
|
|
|
|
Thanks
I had tried ur method however no matter wat I click on it when to the last else statement.
which means "if (e is TreeViewCancelEventArgs)" <== Had always been false
isn't there a way I can stop a NodeMouseClickEvent in a BeforeExpand Method?
if i can do something like this my problem will be solve. that wat I felt coz current situation is that when i click on expand it will call the NodeMouseClickEvent too which my mouse click event had other function to do which will affect the expand method which affect the result I wan to show.
thanks
private void tv_local_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
tv_local.Click -= new TreeNodeMouseClickEventHandler(tv_local_NodeMouseClick);
tv_local.Click += new TreeNodeMouseClickEventHandler(tv_local_NodeMouseClick);
}
|
|
|
|
|
Hi
it seems very odd
so I upload the source that I tried on 2 PCs and it worked well you can test it if you want
here is the link http://rapidshare.com/files/49488493/TreeViewTest.zip.html (does not contain executables)
I sent it to you because I had some GUI problems in programming after installing transform pack on Xp so this code is tested on other two computers and can show this kind of errors
good luck
-- modified at 3:50 Friday 17th August, 2007
|
|
|
|
|
Hi,
thanks.
I can't see the link.
but thanks for the advice it do gif me some clue to do my stuff. thanks alot.
|
|
|
|
|
|
Hi. care to send to my emaiL?
pls thanks.. I can't find my way to download this.
|
|
|
|
|
Ok
but I couldn't find your public email
so try this one http://hjk.4shared.com/
and if did not work give me your Email address
best regards
|
|
|
|
|
I downloaded the source code for Paint.Net. In the History functions Rick Brewster commented that when saving the state of an object, you should store by value rather than reference. Here's a quote:
"...history actions should store large objects and their locations
'by value,' and not 'by reference.'
He advocates to store the index of the collection in which the object resides. Can somebody explain to me what the technical no-no is about storing the reference to an object? I thought an object reference was a int GUID. Kind of a pointer to the place in memory.
Thanks for the help!
may your code be error free
|
|
|
|
|
Hi,
when keeping a time line for an object it would not make any sense to store the
reference at each point in time, since that reference would be the same every
time; one really must store the value so one can undo/redo one or more times
to revert to the object's state at some earlier point in time.
Same is true when you back up a file: you have to copy the content of the file,
not just its name.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for the reply. I may not have explained the scope of the problem. The Undo/Redo stack can contain multiple objects and if only the value is stored, then there is no link by which to apply the value. I guess a good follow up question would be: Is there a performance hit by storing the object reference and the property value?
|
|
|
|
|
Hi,
if undo/redo is required for several objects, one either needs several stacks (one
per object, may be impractical), or some means to identify to which object a value
belongs. A reference may take care of this, other schemes could be devised to.
Keeping a reference is much cheaper than keeping a value, so I would say there
is no performance hit in doing this.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|