|
MS's .NET listview does not support this - it just uses the system highlight color. You might find a listview control here that allows you to do this, or you might want to make your own.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
The ListViewEx class in the SharpLibrary allows this and many other customizations. Here is a screenshot: Screenshot
Regards,
Carlos
|
|
|
|
|
The SharpLibrary looks promising. Great work!
I also liked the icons in your examples. Are they public available?
Øyvind
|
|
|
|
|
|
Hi, Carlos,
Thank you so much..
but could you show me some example how to use ListViewEx class ??
Thanks
|
|
|
|
|
|
Does anyone have any clues as to why I would get an "Unhandled Exception of type 'System.Xml.XmlException'" with the following code sniplet? It just says "Additional information: System Error". What is weird is that the error occurs on the red line and does not throw an exception based on my code (It comes from the IDE). Am I missing something blatant here?
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml("XMLTree.xml");
try
{
<font color="red">XmlNodeList xmlnodeList = xmlDoc.SelectNodes("categories");</font>
foreach(XmlNode x in xmlnodeList)
{
MessageBox.Show(x.InnerText);
}
}
catch(System.Xml.XmlException e)
{
MessageBox.Show(e.Message + "\n\n" + e.StackTrace);
}
-Nick Parker
|
|
|
|
|
your mistake is:
xmlDoc.LoadXml("XMLTree.xml");
you want
xmlDoc.Load("XMLTree.xml");
currently your code thinks that "XMLTre.xml" is xml source
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Philip Fitzsimons wrote:
currently your code thinks that "XMLTre.xml" is xml source
Thanks, that did it.
-Nick Parker
|
|
|
|
|
My guess: it has nothing to do with the categories XPath you gave.
Your xml document is malformed and the parser gets confused in parsing it.
All I need is a roadmap and then I might be able to find a clue.
|
|
|
|
|
i have a quick question about getting sockets to work... im trying to write a simple chat program with a client side program and a server (Async not block sockets). i seem to beable to get the client to connect to the server but i cant get the servers Socket.BeginRecieve method to work correctly it always returns me with a error among the lines of. "The attempted operation is not supported by the object referenced." The code i use for the sockets is as follows.
"Please note that if it is to hard to read here i would be more then happy to send the file. They are both VERY small"
<br />
SentBytes = new Byte[22];<br />
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream,<br />
ProtocolType.Tcp );<br />
IPAddress hostadd = Dns.Resolve("MyIpIsHere").AddressList[0];<br />
IPEndPoint EPhost = new IPEndPoint(hostadd, 8000);<br />
listener.Bind(EPhost);<br />
listener.Listen(22);<br />
listener.BeginAccept(new AsyncCallback(AcceptCallBack),listener);<br />
listener.BeginReceive(SentBytes,0,15,SocketFlags.MaxIOVectorLength,new AsyncCallback(Reciever),listener);<br />
<br />
private void Reciever(IAsyncResult e)<br />
{<br />
string f = ASCIIEncoding.ASCII.GetString(SentBytes);<br />
MessageBox.Show(f);<br />
listener.EndReceive(e);<br />
}<br />
Any ideas would be great. Thanks Alot
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
Hello Jesse,
You are trying to call BeginReceive on the wrong socket. The socket you set up with the Listen() and BeginAccept() requests will simply deliver callbacks to you when clients attempt to connect. In your AcceptCallBack function, you must call EndAccept(), which will return to you a new socket connected to that client. You would then call BeginReceive() on that new socket.
Also, in your Receiver() function, you should use this new socket to call EndReceive() on. The return value from this is the number of bytes you actually received (which may be smaller than you requested.) Note also that if something goes wrong with the network connection, the EndReceive() function will throw an exception, you should be prepaired to handle that.
Hope that helps.
Burt Harris
|
|
|
|
|
Thanks alot burt, I was looking around on the microsoft website and just now figured out the problem. I noticed in vs.nets intelisence that it said it would hand you a new socket but i didnt know what to do with them. thanks alot for clearing that up for me.
I got the program to work (i wouldnt say work good though) now i just need to get it to work 2 way *send / recieve* now. Thanks agian.
Jesse M
p.s :
How is it working for microsoft ? I live about 2 hours from redmond in Wa. Im currently getting my mcsd / bachelors in college right now... hoping to someday work for microsoft.
The Code Project Is Your Friend...
|
|
|
|
|
hi everyone.. im working on a dialog that is very similar to this article written in C++
http://www.codeproject.com/property/saprefs.asp?target=saprefs[^]
i actually have the whole thing working except one small minor glitch that i cant figure out.. i will be posting an article and provide the dialog as freeware, but i need to fix this glitch first..
basicly when you click on the tree on the left i call this function:
private void tvOptionsTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
Form frmSelected = GetSelectedForm();
if (frmSelected == null)
{ MessageBox.Show("An error has occured in the options form which should never occur!\r\ntvOptionsTree_AfterSelect()");
return; }
ShowForm(frmSelected);
} which in turn calls this:
private void ShowForm(Form frmForm)
{
this.SuspendLayout();
if (this.m_frmShownForm != null)
{ this.m_frmShownForm.Enabled = false;
this.m_frmShownForm.Visible = false;
this.RemoveOwnedForm(m_frmShownForm);}
m_frmShownForm = frmForm;
m_frmShownForm.Location = new Point(this.PointToScreen(new Point(0, 0)).X + panel1.Left,
this.PointToScreen(new Point(0, 0)).Y + panel1.Top);
m_frmShownForm.Size = panel1.Size;
m_frmShownForm.FormBorderStyle = FormBorderStyle.None;
m_frmShownForm.ShowInTaskbar = false;
m_frmShownForm.StartPosition = FormStartPosition.Manual;
this.AddOwnedForm(m_frmShownForm);
m_frmShownForm.Enabled = true;
m_frmShownForm.Visible = true;
m_frmShownForm.BringToFront();
m_frmShownForm.Select();
m_frmShownForm.Focus();
m_frmShownForm.Refresh();
} as you can see i put the new form to the front, set it as the focus, enable it, make it visible.. almost everything i can think of.. and it works great.. but..
when the form loads it calls the form load event which in turn calls the tvOptionsTree_AfterSelect function as listed above.. which in turn calls the ShowForm() as listed above.. but i cant click in any of the fields on the dialog on the right hand side which it displayed.. i cant click in a checkbox, i dont get an 'i-beam' when i put the cursor over the textboxes, etc.. as soon as i choose another item in the tree it works.. go back to the starting page and it works.. the whole thing works great after you change the selection on the tree the first time..
ive tried calling tvOptionsTree_AfterSelect multiple times in my form load message handler.. but that doesnt help.. obviously there is something im doing wrong.. the other thing is that when a control in the panel has focus it turns the title bar of the dialog gray, like another dialog has focus.. also my tab order wont go from the main dialog to the subdialog and back and forth.. it cycles through them as seperate dialogs depending on which one has focus.. any suggestions would be much appreciated.. im sure this dialog would help alot of ppl.. i know because the CSAPrefs on CP helped me a bunch in the past..
btw.. i also had to implement moving the subdialog with the options dialog in the options dialog LocationChanged event.. shouldn't it automatically move any child windows when the parent moves? or is it normal to have to override this?
thanks for any and all suggestions!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hi All,
Does anyone know if .Net 2003's DateTimePicker allows null or blank dates? This problem has forced me to set all dates to '1-1-1900' to simulate a blank date.
Also, did the standard Textbox get the same formatting property as the DataGridTextBox. I find it unreal that this was not in the initial release.
Thanks,
Chris
|
|
|
|
|
Hi All,
I am trying to stop the user from going to the last record in a grid, then passing it and creating a 'new' record. I put 'new' in quotes because it does not have a DataRowState value of added and I can not stop it from happening.
I need to not allow this to happen for various reasons, one is security. I have a user level controlled button to perform a NewRow(datarow) for this table in the grid.
Any help would be appreciatted.
Chris
|
|
|
|
|
You need to set it in the data view
<br />
((DataView)((CurrencyManager)this.BindingContext[dataGrid1.DataSource,dataGrid1.DataMember]).List).AllowNew = false;<br />
<br />
<br />
|
|
|
|
|
Thank you very much. It still allows me to add my new row by .NewRow(nr), but does not allow the automatic new row in the grid. Just what I needed.
|
|
|
|
|
If I dig into MSDN files, the help on creation of context-sensitive help states that I do the following:
eliminate Minimum and Maximum buttons,
add the HelpProvider to the form,
populate HelpString with the text I want displayed
Now what this does is require the user to
click the ? on the menu bar,
mouse-over the control in question,
left-mouse-click the field
What I get is a small, yellow window with the text compressed into a small display area.
I've constructed a full help file for the application which included help at the screen level with invisible topics for the various controls. I assigned context topic numbers to each topic with a unique keyword assigned to each topic and I TRIED to get the helpProvider properties set:
HelpNavigator = (I cycled through EVERY option)
HelpKeyword = context ID, topic, hidden topic name, unique keyword
When I place the cursor inside a control and hit F1, all I get is the help file positioned to either Contents, Index, or Search and the displayed help page is the Welcome page (first page in file)
Doesn't the HelpProvider support standard context help anymore? What am I missing?
Later
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
When my C# service is configured to use any account otherthan SYSTEM it does not show up under the .NET CLR Memory performance counters. This seems like a bug? Can anyone else confirm this? I'm using version 1.0 in WinXP Pro.
|
|
|
|
|
I have a Windows Forms application that requires to read an XML, i know you can put something like
<add key="serverPath" value="http://localhost/something.aspx">
but in the case the value is XML what can I do? i tried to put the xml inside the value but it didnt work
<add key="test" value="<hi>">
i had to do it this way
<add key="test" value="<hi>">
that worked, but it would be too hard for the user to edit and not make mistakes when the XML grows, so i was wondering if there is any way I could just put my xml tags somewhere in the .config file where it doesn't make the application crash
something like this
<configuration>
<appsettings>
<add key="serverPath" value="http://localhost">
<mytag>
<moretags>blah
I basically want to avoid that some settings are stored in the .config file and others in a different XML file
Thanks in advance
|
|
|
|
|
I have a Windows Forms application that requires to read an XML, i know you can put something like
< add key="serverPath" value="http://localhost/something.aspx" / >
but in the case the value is XML what can I do? i tried to put the xml inside the value but it didnt work
< add key="test" value="< hi >" / >
i had to do it this way
< add key="test" value="<hi>" / >
that worked, but it would be too hard for the user to edit and not make mistakes when the XML grows, so i was wondering if there is any way I could just put my xml tags somewhere in the .config file where it doesn't make the application crash
something like this
< configuration >
< appSettings >
< add key="serverPath" value="http://localhost" / >
< /appSettings >
< myTag >
< moreTags > blah < /moreTags >
< /myTag >
< /configuration >
I basically want to avoid that some settings are stored in the .config file and others in a different XML file
Thanks in advance
|
|
|
|
|
this is getting complicated to post
when i wrote "i had to do it this way" and the sentence looks identical i wrote
& lt; hi & gt;
the question at the end is can i add my own tags to the .config file?
Thanks
|
|
|
|
|
Damn the board did it to me too.
<configsections>
<customsettings>
<add key="x" value="y">
Reading your custom section
GetConfig("customsettings")("x")
Hope this helps
He who laughs last thinks slowest.
|
|
|
|
|
Damn the board did it to me too.
<configSections>
<section name="customSettings"/>
</configSections>
<customSettings>
<add key="x" value="y" />
</customSettings>
Reading your custom section
GetConfig("customsettings")("x")
He who laughs last thinks slowest.
|
|
|
|