|
b3t1m0s wrote: Can anyone realize multi level pie chart (3 level) in .net (winform or wpf)?
what do you mean by Word "realize"?
Have you looked into commercial control such as Dundas Chart for .NET?
|
|
|
|
|
I have a .NET PropertyGrid that (amongst other things) display a property with the validation rule:
[IntegerValidator(MinValue = 1, MaxValue = 5)]
If the user attempts to set it to a value outside the range then I would expect a "Properties Window" dialog with the message "Property value is not valid" and a Details button that allows the dialog to be expanded to display the message:
"The value for the property 'XXXX' is not valid. The error is: The value must be inside the range 1-5."
Occasionally though I just get an exception that is caught at the top level by my application (which then terminates).
Any ideas why this should happen? (It does seem to happen when, on leaving the cell, the user immediately scrolls the grid - but not always.)
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
Is this Grid a external control (in Dll)?
Wags wrote: Occasionally though I just get an exception that is caught at the top level by my application (which then terminates).
I presume is that refers to class (program.cs) where main form gets to be run? Or Just a from place where it was assigned that value to the control.
Have you tried updating your .Net Framework? Have you Looked in MSDN?
|
|
|
|
|
I hadn't noticed that the PropertyValueChanged event was being handled.
"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International
|
|
|
|
|
I've got a class which connects to server. Then the server sends to client at some specific time intervals data.
I've got a problem in recieving that data if single read is less than the whole data to be transfered
e.g. 10K is going to be sent. I BeginRead with 1024 buffer as in TcpClientData class with all public fields.
These are the 2 functions from the class
class MyClient
{
private void ConnectButtonClick(object sender, EventArgs e)
{
TcpClient tcpClient = new TcpClient();
tcpClient.Connect(ipAddress, port);
NetworkStream ns = tcpClient.GetStream();
TcpClientData cd = new TcpClientData();
cd.tcpClient = tcpClient;
cd.ms = new MemoryStream;
cd.packet = new byte[1024];
ns.BeginRead(cd.packet, 0, cd.packet.Length, new AsyncCallback(TcpClientDataReadAsyncCallback), cd);
}
private void TcpClientDataReadAsyncCallback(IAsyncResult ar)
{
TcpClientData cd = (TcpClientData)ar.AsyncState;
NetworkStream ns = cd.tcpClient.GetStream();
int sz = cd.ns.EndRead(ar);
cd.ms.Write(cd.packet, 0, sz);
while (ns.DataAvailable == true)
ns.BeginRead(cd.packet, 0, cd.packet.Length, new AsyncCallback(TcpClientDataReadAsyncCallback), cd);
cd.ms.SetLength(0);
cd.ns.BeginRead(cd.packet, 0, cd.packet.Length, new AsyncCallback(TcpClientDataReadAsyncCallback), cd);
}
}
What is wrong?
Чесноков
|
|
|
|
|
I suspect the problem is with this bit:
while (ns.DataAvailable == true)
ns.BeginRead(cd.packet, 0, cd.packet.Length, new AsyncCallback(TcpClientDataReadAsyncCallback), cd); It's recursively (kinda) calling itself who knows how many times in the middle of its processing. That might have been intended to be a synchronous read instead of an asynchronous one. If you want to rely solely on asynchronous comms then the read callback function might need a little redesign.
|
|
|
|
|
I do not know if you answer was correct but when I changed to:
if (ns.DataAvailable == true)
{
ns.BeginRead(cd.packet, 0, cd.packet.Length, new AsyncCallback(TcpClientDataReadAsyncCallback), cd);
return;
}
It worked.
The async data recieving is that kinda of recursive approach
Чесноков
|
|
|
|
|
Hello,
I m creating a C# .NET Project in which i m trying to load third party Assemblies which are installed in GAC.
But in some machines I m getting an error stating "Unable to Load assembly of specified version 7.0.351.0".
when i tried to do an assembly redirection it didn't work it still shows the same error.
Note:
7.0.351.0 - Is the version with which it is compiled.
12.0.0.0 - Assembly present in the Target machine
Properties of Reference
Specific Version -> False
Aliases -> global
Copy Local -> False
This is my sample application configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyIdentity
name="Act.Framework"
publicKeyToken="ebf6b2ff4d0a08aa" />
<bindingRedirect oldVersion="7.0.351.0"
newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I have not placed the assemblies in application path, I just want it to redirect to the version present in the GAC(12.0.0.0).
How do I Proceed with this?
Thanks in Advance.
|
|
|
|
|
You will get this error if any dependent assemblies can't found also. Make sure everything is in place.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
a
modified 23-Nov-14 7:20am.
|
|
|
|
|
mdichild forms do not support transparency.
Normally the Paint event of a form does nothing (unless you have handled it), and so you see through to the results of the paintBackground event. In the case of a transparent form this paintBackground event handles painting the stuff underneath your form.
As soon as a form is made an mdiParent the paint event forces painting totally filled with the colour 'AppWorkspace'.
For mdiChildren it is a bit different. They now ignore the TransparencyKey, so the only thing you can do is set the backColor to Transparent, therefore making the MDIParent backColor display in the child. Note this is not transparency but just delegating the backColor to the mdiParent and so not that usefull. If you want to do this you will have to force your form to accept Transparent as a backColor which it does not normally do. To do this add the following two lines to the constructor of the mdiChild form.
this.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = System.Drawing.Color.Transparent;
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hiii all...........
I need helping for how can i use the winpcap & winDump libraries for capture and dump IP packets using C#.........
Thanks..
|
|
|
|
|
Hi
I would like to define a struct with array of int
I define the struct as below
The problem is that when I want to get the size of the struct, i'm getting it without the array size
such as
sNDIS_802_16E_ACTIVE m_NDIS_802_16E_ACTIVE;
m_NDIS_802_16E_ACTIVE = new sNDIS_802_16E_ACTIVE(20,20);
int size = Marshal.SizeOf(m_NDIS_802_16E_ACTIVE);
public struct sNDIS_802_16E_ACTIVE
{
public UInt32 NaplistLength;
public UInt32[] Nap;
public UInt32 NsplistLength;
public UInt32[] Nsp;
public byte [] aaa;
public sNDIS_802_16E_ACTIVE(UInt32 maxNSP_NAPSize, UInt32 maxNSP_NAPsize)
{
Nap = new UInt32[maxNSP_NAPSize];
Nsp = new UInt32[maxNSP_NAPSize];
NaplistLength = 0;
NsplistLength = 0;
}
} ;
please advice
ronen
|
|
|
|
|
the size of
public struct sNDIS_802_16E_ACTIVE {
public UInt32 NaplistLength;
public UInt32[] Nap;
public UInt32 NsplistLength;
public UInt32[] Nsp;
public byte [] aaa;
}
is 20B on Win32, i.e. 4B for each of the two ints, and 4B for each of the 3 arrays (an array is just a reference, not the data; the data sits elsewhere).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi
But I define the size of the array size in the constructor
Should the size of the member of the struct include array definitions?
Ronen
|
|
|
|
|
I don't understand your question.
In THAT struct, under Win32, each member takes 4 bytes, either for an int value, or for a reference. The size of the arrays themselves is irrelevant inside the struct, as they are separate objects.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
All -
I am looking for an easy solution to split a name field from another DB. I am converting data from on DB to another. In the source DB the name field is one field that is free form. Here are some examples of names:
John Smith
John E Smith
DR John E Smith
DR John Smith
In my db the name field is first and last name (separate fields).
Any suggestions?
As always thanks for your help!
sk
|
|
|
|
|
Its a tricky one because you have a number of possibilities, i.e. Title and middle names.
If this was a one of process I would use manual intervention, but would also have fields for title.
Do you want to retain the title anywhere? where should the middle name be included? I would put the middle name with the forename if I only had two fields (forename, surname)
Why don't you try something like...
void GetMeSomeNames(string fullname, out string forename, out string surname)
{
forename = surname = "";
string[] names = fullname.Split(' ', StringFormatOptions.RemoveEmptyEntries);
if(names.length == 0)
return;
if(names.length == 1)
{
forename = names[0];
return;
}
bool hasTitle = false;
switch(names[0].ToLowerInvarient())
{
case "dr":
hasTitle = true;
case "mr":
hasTitle = true;
}
for(int i = (hasTitle ? 1 : 0); i < names.length - 1; i++)
forename += names[i] + " ";
forename = forename.Trim();
surname = names[names.length-1];
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Essentially, it is a tough task. There may be names that just have a first and last or first, middle and last and it may contains salutations (Dr, Mr, Mrs, etc.) also. Writing a script to take care of all of these scenarios is really difficult. Just give it a try.
|
|
|
|
|
You need some sort of agreement on what is considered first name and what is considered last name.
You could also have the following eg:
John Smith Peeters
John Edward Smith
John Edward Smith Peeters
John Edward Smith-Peeters
John E. Smith-Peeters
...
You could filter Dr, DR, Mr, Ms, ... as a title and one letter words (with or without . like E or E.) can be considered firstnames, but I'm not sure if it's possible to have a 100% correct algorithm.
good luck.
|
|
|
|
|
I don't think it can be done without human intervention. At best you could put the last element in the last name field and everything else in the first name field. Then review any first names that contain a SPACE.
|
|
|
|
|
PIEBALDconsult wrote: At best you could put the last element in the last name field and everything else in the first name field.
That would yield a lot of problems where I live, as:
1) a lot of last names consist of two or three words, such as
"Miel De Schepper" and "Jan van der Spiegel" (first names are Miel/Jan); here you should at least check for "de", "van der" and "van de" (all possible capitalizations) and when they occur they are part of the last name.
2) first names could be composite ("Jean-Paulus") and last names could be composite ("Paulus-Beeldens"); now what when one of them is composite, the hyphen is missing, and the middle word of three could be a second half of the first name, or the first half of the last name (say "Jean Paulus Beeldens")?
I am 100% sure there isn't an algorithm that solves the problem, and IMO the best fit algorithm is very region dependent.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi,
I am displaying Word Document using Web Browser, its working fine but i just want to show the text of that Word file. But currently its showing the Text as well the MenuBar on the top. Is there any way to hide the toolBar and so it only shows the Text ?
|
|
|
|
|
Hi
I have a form that has text boxes and combos bound to fields in an object. When the user is using the form they have the option to apply some default values to some of the fields. I was hoping that I would just have to either update the control with the value or just update the field in the object. When I update the field in the object, the form will not refresh with the new values until another field on the form is changed. If I update the control, the field in the object does not update.
My way around this was to update both like this
case "LOGCERT_LEVEL_":
logginCertCombo.SelectedValue = newValue;
staff.LogCert = newValue;
break;
To me that is a bit ugly
Is there a way to do this automatically? My controls are bound like this
logginCertCombo.DataBindings.Add("SelectedValue", staff, "LogCert");
I've tried google and today it is not being my friend.
Many Thanks
The FoZ
|
|
|
|