|
Are you sure your configuration file syntax is correct?
I haven't used them myself (in fact, I happen to hate the xml config files :p) but it sounds to me like your customSection dictionary is not being found.
|
|
|
|
|
If that is the case, then something must be wrong with the examples in the books. LOL
|
|
|
|
|
How can I programmatically determine whether a text in a listview column is longer than the column's width (i.e. displayed partially and ends with ellipsis)?
Thanks!
|
|
|
|
|
Try this
protected virtual void GenericListControlMouseMove(object sender, MouseEventArgs e)
{
Point ptOnlist = Point.Empty;
ListViewItem item = null;
int subItemIndex = -1;
int subItemTextWidth = -1;
ListViewItem.ListViewSubItem curSubItem = null;
try
{
//
/// Check if no mouse button is down
//
if (e.Button == MouseButtons.None)
{
item = this.GetItemAt(e.X, e.Y);
if (item != null)
{
subItemIndex = this.GetSubItemIndexFromPoint(item, new Point(e.X, e.Y));
if (subItemIndex != -1)
{
//
/// Get the subItem on which the mouse pointer is present
//
curSubItem = item.SubItems[subItemIndex];
if (curSubItem != null)
{
if (curSubItem.Text.Length > 0)
{
subItemTextWidth = this.ListViewGetStringWidth(curSubItem.Text);
if (subItemTextWidth != -1)
{
//
/// MSDN:: ListViewSubItem text is padded 6 pixels on both side of the Text
//
subItemTextWidth += LISTVIEWSUBITEM_STRING_PADDING;
if (subItemTextWidth > this.Columns[subItemIndex].Width)
{
if (curSubItem != this.lastSubItemHovered)
{
this.SetToolTipText(curSubItem.Text);
this.lastSubItemHovered = curSubItem;
}
}
else
{
this.SetToolTipText(string.Empty);
}
}//end subItemTextWidth
}//end curSubItem.Text
}//end curSubItem
}//end subItemIndex
}//end item
}//end e.Button
}
catch (Exception exception)
{
ExceptionDisplayer exceptionDisplayer = new ExceptionDisplayer(exception);
}
}
protected int ListViewGetStringWidth(string subItemText)
{
IntPtr hString = Marshal.StringToHGlobalAuto(subItemText);
int width = UnsafeNativeMethods.SendMessage(this.Handle, LVM_GETSTRINGWIDTHW, 0, hString);
Marshal.FreeHGlobal(hString);
return width;
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
|
I'm just starting to learn about signing and my assemblies. I have two assemblies - dlls - written in C#. A.dll references B.dll - both mine. I'm attempting to add a strong name to A.dll - I've used "sn -k A.snk" and in Assembly.info set the AssemblyKeyFile to "A.snk". When I try to build A I get an error:
Assembly generation failed -- Referenced assembly 'B' does not have a strong name
Do all of my assemblies have to use strong names if they are referenced from another assembly that is using strong names?
|
|
|
|
|
dirkhelmet!@yahoo.com wrote:
Do all of my assemblies have to use strong names if they are referenced from another assembly that is using strong names?
Any strong-named assembly can reference only other strong named assemblies, so, yes you must give b.dll a strong name as well.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Hi experts ,
I am faceing a exception in my Socket programm.
I am created a TCPListner() and it it wait's for TcpClient() request.
After connecting server to client i am sending some txt file content as String through NetWork stream to client. Again When Client Disconnect, it send some same file content after modification to server .
Now When i am closing the Server , I get a WSACancelBlocking Exception.
I am Giving Some Code What i am doing in server and Client :
Server ()
{
using namespace System.net.socket ;
-----
----
DoListen()
{
listener = new TcpListener(PORT_NUM);
listener->Start();
Byte bytes[] = new Byte[10000];
String* m_sdata = 0;
While (true)
{
UserConnection *client = new UserConnection(listener->AcceptTcpClient());
__hook(&UserConnection::LineReceived, client, OnLineReceived);
}//End of while(true);
}
}/* end of server */
Client()
{
Byte data[] = new Byte[1200]
Byte data1[] = new Byte[1200];
Int32 port = 10000;
//writting data to Stream.
}
Now When i close the Server File i got two Exception
1. ASCII Encodding Exception
2. WSA CancelBlocking CAll Exception.
Please i need the Solution for this.
Please help me..
sukanta
|
|
|
|
|
hi,
i want to make a program that draw equations.
the first thing needed is to evaluate the expression.
i used the stack to make infix to postfix conversion, but the problem here is in
the priority how can i implement the priority with out forcing the user to write every
operation between brackets ???????
any help please
thanx in advance
|
|
|
|
|
It's pretty simple actually, create an operator stack and push operators into them depending on priority. The algorithm looks like
For each element in the expression
1. If current element in expression is a number, print it out.
2. If current element in expression is an operator
a. If stack is empty, push operator into stack.
b. else, if current operator has greater precedence than operator at the top of the stack, push the current operator also into the stack.
c. else, pop operator at the top of the stack and print it
Print out contents of the stack.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thnx for ur help ,i will try this
|
|
|
|
|
You ca also create a block of C# code with a static function that returns the value of the expression, such as 'return (12 * 25 + System.Math.Sin(System.Math.PI));', and compile it on-the-fly in a memory assembly, then call the method and obtain the result. Try this article:
DotNetCompiler
It is in VB.NET, but i'm sure you won't have problems...
|
|
|
|
|
Hello All,
I have added a bool check column to Datagrid.but i dont know how would i come to know that whether that checkbox is selected or not because depending on that checkbox value i have to change value in another column?
|
|
|
|
|
Hi amrutajoshi,
Probably this may help you
foreach(DataGridItem childItem in myGrid.Items)
{
CheckBox myBox = (CheckBox) childItem.FindControl("MSChecked");
if(myBox != null && myBox.checked)
{
Response.Write("Checked");
}
}
Srinivas
|
|
|
|
|
Well i dont know if the datagrid is in Web or Forms ?.
But if it is in Web do you want it clientside or serverside ?.
If Serverside its very simple
your CheckBox has a OnChangedEvent create a method and call it from there
asp:CheckBox OnCheckedChanged="doWork" id="myCheckBox" runat="server">
|
|
|
|
|
I'm doing some interop and passing a structure to managed code via an IntPtr.
I convert the structure to the IntPtr as follows, in a mixed-mode C++ program, which then passes it to the C# program:
System::IntPtr func(Event &e)<br />
{<br />
return __nogc new System::IntPtr(&e);<br />
}
I'm not too confident about my mixed-mode C++ skills, but I think that's right... right?
However, the data I get back from PtrToStructure gives me complete gibberish. It's not a member alignment problem either, because the data is supposed to be mostly nulls but I get numbers in the millions (Event contains mostly pointers to other structures).
What am I doing wrong?
|
|
|
|
|
Ok, I solved it.
In case anyone wants to know, the problem was caused by IntPtr.
Basically, IntPtr(void*) does NOT wrap a pointer into a managed pointer. Instead, it creates a managed pointer TO an unmanaged pointer. Very wrong.
The solution was to simply use static_cast to convert the umanaged pointer into a managed one.
|
|
|
|
|
Hi
I am now working in c# with infragistics.
I am new to infragistics. so
i feel very difficult .
pls anyone can tell me the tutorials for infragistics which r easy to learn (other than http://devcenter.infragistics.com site)
j o h n
|
|
|
|
|
Please ,give me some information
|
|
|
|
|
I already re-draw listview Frame ,code:
private void OverrideControlBorder(Graphics g)
{
Pen BorderPen = new Pen(Color.FromArgb(127,157,185), 1);
g.DrawRectangle(BorderPen, new Rectangle(0, 0, this.Width - 1, this.Height - 1));
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_PAINT:
IntPtr hDC = IntPtr.Zero;
Graphics gdc = null;
hDC = GetWindowDC(m.HWnd);
gdc = Graphics.FromHdc(hDC);
OverrideControlBorder(gdc);
if((this.Font.Height - 1) * this.Items.Count > this.Height)
{
OverrideVertScrollBar(gdc);
}
ReleaseDC(m.HWnd, hDC);
gdc.Dispose();
default:
break;
}
base.WndProc (ref m);
}
|
|
|
|
|
OverrideVertScrollBar(gdc);
about this function,How do I Write?
Thank you!
|
|
|
|
|
|
I used to know how to get a WinForm to display AND have the Console Window appear at the same time-
I don't really care if they overlap as long as both appear.
-- thanks in advance
|
|
|
|
|
Set the project type to Console Application.
There you go, you now have a console.
Then create any forms you wish.
There you go, you now have both.
|
|
|
|
|
i've created a form with 2 panels 3 button, 1 controlbox...
I need to draw a blue rect over all.
Can i do it directly using Graphics (no with picturebox)?
|
|
|
|