|
Hi all,
I am overridding WndProc method in C# for RichTextBox to handle the paste functionality.If i inherit TextBox, the message id 0x0302 gives WM_PASTE handler, but if i use RichTextBox it is not working. Is there any specific WM_PASTE message id for rich textbox. How can i know various MessageIds for RichTextBox.
|
|
|
|
|
Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name.
The code:
MyListBox.DataSource = MyObject<br />
MyListBox.ValueMember = "ID"
MyListBox.DisplayMember = "SubObject.Name"
|
|
|
|
|
DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this.
Anil Joshi
|
|
|
|
|
This has nothing to do with SQL. The data is coming from a Xml-File. But that is not the point. What MyListBox.ValueMember = "ID" does is bind it with a Property in the already bound MyObject. So the question remains is it possible to use a property of a property as a DisplayMember?
/Johan
|
|
|
|
|
Hi everybuddy,
I'm required to submit project on Mail Server after approx 2 months using .NET technologies (ASP.NET or C#.NET) but I dont know wat is a background functionality of the mail server
Please tell me how could i start the project and form which site(s)/forum(s) i can get the information about the functionality of a Mail Server
HELP ME Pleeeease,
|
|
|
|
|
|
Hello,
I have a window application with a datagrid on it. (Data bound from a dataset). Each row has an order number (stoporder).
Now I want the user to be able to move the rows up and down with an up and down button(and automatically change the number).
I can do this ok, if I manually click the order number first. (Then my rows move up and down and the number alters.) But how can I do this in the code? If I sort on any other column, then the up/down goes wrong too.
<br />
private void btnRouteStopUp_Click(object sender, System.EventArgs e)<br />
{<br />
DataRow row;<br />
int stopOrder;<br />
DataRowCollection rowCollection;<br />
int inc;<br />
<br />
try <br />
{<br />
row = GetRouteStopsRow ();<br />
dtRouteStops.UnSelect(dtRouteStops.CurrentRowIndex);<br />
inc=dtRouteStops.CurrentRowIndex;<br />
<br />
if (null != row) <br />
{<br />
stopOrder = Convert.ToInt32(row[FLD_STOPORDER]);<br />
if (stopOrder > 1) <br />
{<br />
stopOrder -= 1;<br />
row[IMS.FLD_STOPORDER] = 0;<br />
rowCollection = m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows;<br />
foreach (DataRow rowMove in rowCollection) <br />
{<br />
if (DataRowState.Deleted != rowMove.RowState) <br />
{<br />
if ((row != rowMove) && (Convert.ToInt32(rowMove[FLD_STOPORDER]) == stopOrder)) <br />
{<br />
rowMove[FLD_STOPORDER] = stopOrder + 1;<br />
row[FLD_STOPORDER] = stopOrder;<br />
break;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}<br />
dtRouteStops.Select(inc-1);<br />
}<br />
catch (System.IndexOutOfRangeException ex)<br />
{}<br />
catch (Exception exc) <br />
{}<br />
}<br />
<br />
private void btnRouteStopDown_Click(object sender, System.EventArgs e)<br />
{<br />
DataRow row;<br />
int stopOrder;<br />
DataRowCollection rowCollection;<br />
int inc;<br />
<br />
try <br />
{<br />
row = GetRouteStopsRow ();<br />
dtRouteStops.UnSelect(dtRouteStops.CurrentRowIndex);<br />
inc=dtRouteStops.CurrentRowIndex;<br />
if (null != row) <br />
{<br />
stopOrder = Convert.ToInt32(row[FLD_STOPORDER]);<br />
if (stopOrder < m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows.Count) <br />
{<br />
stopOrder += 1;<br />
row[IMS.FLD_STOPORDER] = 0;<br />
rowCollection = m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows;<br />
foreach (DataRow rowMove in m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows) <br />
{<br />
if (DataRowState.Deleted != rowMove.RowState) <br />
{<br />
if ((row != rowMove) && (Convert.ToInt32(rowMove[FLD_STOPORDER]) == stopOrder)) <br />
{<br />
rowMove[FLD_STOPORDER] = stopOrder - 1;<br />
row[FLD_STOPORDER] = stopOrder;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
dtRouteStops.Select(inc+1);<br />
}<br />
catch (System.IndexOutOfRangeException ex)<br />
{}<br />
catch (Exception exc) <br />
{} <br />
}<br />
Any suggestion?
thx in advance,
kalliet
|
|
|
|
|
what I forgot to add :
dtRouteStops is the name of my datagrid
m_dataSetRouteStops is the name of my dataset
kalliet
|
|
|
|
|
in the load method, I added :
m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].DefaultView.Sort = "stopOrder asc";
The column is now sorted from the start, which makes the up/down go OK.
Now I have a new problem : how do I set the grid on sorting not allowed? (so the user cannot sort on other columns)
I've tried the property :
dtRouteStops.AllowSorting = false;
but when the form appears I CAN sort on columns of the datagrid ????
any ideas?
thx in advance,
kalliet
|
|
|
|
|
hi
i want to include dll for reading and writing data from parallel port in NT base windows.
now i have a dll for this perpose but it not include in c#.
plz tell me how to inculde dll. and if, for this perpose handler will create then how create that handler and how use the dll.
reply me soon
bye.
|
|
|
|
|
I have a public static function in a class named "PublicFunctions". I call this function in my MDI form's "MdiChildActivate" event. What the function do is, it takes current activeMdiChild as argument and set a public variable present in this activeMdiChild. All the child forms have this public variable "formCurrentMode", which i use to store form's current mode like "update","save","new" etc.
My problem is, in my public static function in class "PublicFunctions" i am getting an error that 'System.Windows.Forms.Form' does not contain a definition for 'FormCurrentMode'.
Please help me to solve this problem.
Thanks
Sheel
Sheel Gohe
|
|
|
|
|
I have a question which I am sure someone has had before me:
when implementing drag'n'drop for a treeview control I have no problem, except that when dragging over an area in the treeview control which is empty (lets say i have only three nodes, but the control is much higher than this), The drop operation is not allowed, only when dragging onto previous nodes. Why is that? Can I do something about it in an easy way?
thankful for help,
Bjørn
|
|
|
|
|
Hello,
i have read on msdn the documentation referring to DPAPI. i have also tried those examples and when i have reached the user store problem i have noticed that there is an access conflict on DataProtector constructor (when i try to initalize an DataProtector object) so firstly i set the COM+ DPAPI Helper Application to run as a service (as in msdn's example) and it didn't work. secondly i set the COM+ application to run as library and it worked . my little question is what should i do to make DPAPI work in user store problem
Thanks, claudia
|
|
|
|
|
In vb.net when i declare a variable as object type then i can set any property for that object that is not assigned at design time but but will be assigned at runtime. for example:
dim a as object
if typeof a is textbox then
a.name="test1"
end if
The above code will not give any error at design time in vb.NET but in C# it will give an error during design time only - "'object' does not contain a definition for 'name'".
Please help me,how do i solve this problem.
Thanks in advance
Sheel
Sheel Gohe
|
|
|
|
|
The following should work:
if (typeof(a) is TextBox)
{
((TextBox) a).name="test1";
}
www.troschuetz.de
|
|
|
|
|
Thanks Stefan.
Sheel Gohe
|
|
|
|
|
Actually the codes should be:
object a = new object();
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
Or:
object a = new object();
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
|
|
|
|
|
Actually, your code is just as incorrect.
LdqxYY wrote:
object a = new object();
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
If a has been instantiated as an object, then the line
if(a is textBox)
will always evaluate false
then in your second example:
LdqxYY wrote:
object a = new object();
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
you are testing to see whether an instance of System.Type is-a TextBox - which it clearly isnt it is System.Type!
To correct these two examples assume that there is a TextBox on the form with the instance name myTextBox. Now assume that you have a variable named myVar which is of type object, but is set to myTextBox
if(myVar is TextBox)
{
((TextBox)myVar).Text = "Hello World";
}
or in the second example above
if(myVar.GetType() == typeof(TextBox))
{
((TextBox)myVar).Text = "Hello World";
}
|
|
|
|
|
J4amieC,you are right!And I had realized my second example were incorrect after submitted.By the way,what exact mean in my first example is:
object a = new object();
//
//some codes handle with the "a"
//
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
I forgot writing something,hehe...
Thanks again!
|
|
|
|
|
God!Wrong again,sorry!It should be:
object a = new object();
//
//some codes handle with the "a"
//
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
|
|
|
|
|
LdqxYY wrote:
were incorrect after submitted
That's why we have a Modify button
|
|
|
|
|
How to make crystal report with utf-8 (my database is SQL 2000 and data was stored in UTF-8)
thanks,
|
|
|
|
|
Ok guys, i not even know if it's a problem but i've seen many c# tutorials that explain assembly compilation by command line and i've seen they usually use "csc (my arguments...)".
That "csc" is a bit strange for me because they only use csc directly("c:\>csc myarguments..." for example) but i have to type all the path to the csc.exe file (C:\Windows\Microsoft.NET...csc.exe Myarguments...).
How can i create a link to csc?
Thanks in advance
Heinz Suez
|
|
|
|
|
Add it's path to your path variable or copy it to a path that is there already, such as system32.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|