|
Thank you for your answer ~
|
|
|
|
|
It can't be done AFAIK. You can disable it, remove the Close menu (and separator) from the system menu and handle Alt+F4 - but that's as close as you can get.
You could create your own control class that has this functionality but it would be a LOT of work to just make a button invisible when it can be disabled with little effort.
Dave
|
|
|
|
|
|
Well remembered!
For the OP:
In my article here[^] I have demontrated this and the removal of the close + separator from the system menu.
Dave
|
|
|
|
|
good~ I will see that.
Thank you for your answer.
|
|
|
|
|
I have a setup window where I would like the user to select which directory the data files will be kept. In order to make this as easy as possible, I would like the user to choose from an openfile dialog, but it does not seem to have a method that returns the directory of choice.
I looked at openfile dialog and file dialog.
Using v1.1 net
Thanx in advance
Jude
|
|
|
|
|
FolderBrowserDialog
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is it better to have an AIP and subscribe to a changed event to update the GUI when the property changes, or to specify a backing field and add the GUI update code to the set method?
Thanks,
Sam
|
|
|
|
|
I Hope i understood u
it is always better to Subscibre to an event when a Property is Changed
if it's your Property
Like
public int MyPropery
{
Get {return myPropery;}
Set {myPropery = value;//Do Something according to the Cahnge//}
}
Hope i could Help
Have Fun
Never forget it
|
|
|
|
|
there exist is a big conversation about this . has to do with mvc architecture .if you want standard .net framework look at microsoft databinding . every control has a data binding list .you can unify the way bi directional notification is made use code like this
textBox.DataBindings.Add("Text",object,object.property); wich means syncronize the textbox .text with the object.property
it is a dificult subject but worth it . or use the code the friend just gave you.
http://www.codeproject.com/KB/database/databindingconcepts.aspx[^]
http://msdn2.microsoft.com/en-us/library/ms752347.aspx[^]
f(yf) = yf
modified on Thursday, March 27, 2008 4:33 PM
|
|
|
|
|
I am having Visual C# 2005..
But the breakpoints dont seem to work when I create a console application..
Why?
It works in a windows form application though..
|
|
|
|
|
Debug breakpoints in console apps work just fine. You are running in debug mode, yes?
|
|
|
|
|
It could also be that terminal services service is inactivated.
For some reason, the TS service is used for debugging winforms and console apps.(dont know if it affects asp.net debugging to)
And im not talking about remote debugging, just normal local debugging.
I had this problem once and after some serious headscratching i found out about this on some msdn page.
|
|
|
|
|
Hi,
I have a BackgroundWorker that i use to select from a database. At the moment i have a ProgressBar that just loops so the user isn't just sat there wondering whats going off, but i want to make it so it actually links into how many rows i have selected so far.
eg: the ProgressBar is actually displaying the current progress of the select
Does anyone know how i would go about this?
Regards,
Gareth.
|
|
|
|
|
Hi Gareth,
if your database access is a single query, you will not be able to get any
meaningful progress information: the query is either ongoing or done, that's it.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi Luc,
I was hoping you weren't going to say that!, Ahh well.
Regards,
Gareth.
|
|
|
|
|
[rant]
Why is that when I assign the same data source, like a List<string> to two ComboBoxes (for example), the two ComboBoxes synchronize their selection? Why should a List<string> data source (or any data source for that matter) be shared in anything other than a read-only, here's the list usage? Ok, yeah, I get that the control needs to update if the data source changes, but even then, why should that cause the selection of an item in ComboBox 1 to cause ComboBox 2 to make the same selection??? This is ridiculous! It is not that uncommon to offer selections using the same data source, but now I have to clone the damn thing to decouple this "feature".
[/rant]
|
|
|
|
|
Hi Marc,
the plus side is you can have many controls on one or more containers, all
behaving like clones of each other.
the down side is as you said.
the reason probably is each data source supports multiple viewers but only one view,
i.e. all viewers get exactly the same data, selection, etc.
BTW: great subject line!
PS: I reckon Chris would answer "by design".
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
HI,
i do not get it
i have two ConboBox That are Bound To a Table in the a DataSet
and i do not have This Problem
is it because i've Got A main BindingSource To The DataSet
and A BindingSource To Each Table In the DataSet??
or i'm just talking CRAZY ?
Have Fun
Never forget it
|
|
|
|
|
Well, maybe because working the other way round is more troublesome to implement?
Sometime I need to bind 2 controls to the same source. One for selecting the item on one part of UI and another part for displaying the selected item for reference on another part of UI. If it works the other way, I will have add the selection change handling on both control.
|
|
|
|
|
I'm trying to use sockets to create a proxy connection to a server. The whole thing worked perfectly until I tried to add a custom class to deal with the proxy (authentication etc). I have two sockets, ListeningSocket and DataSocket.
The problem is that I can't see to get listeningsocket to accept datasocket as a ProxySocket, only as a standard socket.
ProxySocket extends Socket, but I can't get it to work.
Here's the code:
In the head of the class
private ProxySocket dataSocket = null;<br />
private Socket listeningSocket = null;
The in the method to accept the connection.
listeningSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
listeningSocket.Bind(localEnd);<br />
listeningSocket.Listen(1);<br />
Socket dataSockTemp = listeningSocket.Accept();
dataSocket = dataSockTemp as ProxySocket;<br />
listeningSocket.Close();
I'd really appreciate any help.
|
|
|
|
|
Hello Guys,
My scenario is, i have a mainform with many dockable controls. And each dockable control can have panels and some intrinsic controls (textbox, labels...). If i select text in one of the controls, toggles out and in that selection is disappearing. Basically cursor state is not getting persisted. Is there a way Windows forms take care of this or do i need to write some code on Activate/Deactivate events for persisting cursor state and setting back the cursor position?
Thanks.
|
|
|
|
|
asp.net 2.0 c#
Could you show me an example about
validating an XML string with an XSD file ?
(note: I found a lot of examples about XML files,
nothing about XML strings )
I have already managed validation with asp.net 1.1
but I'm facing problems with visual studio 2005 syntax .
Could you help me ?
Thanks in advance .
|
|
|
|
|
anto2005,
Provide some code and what the syntax errors are and maybe we can.
Regards,
Gareth.
|
|
|
|
|
this is my code :
public bool ValidateXML(string xml, string xsdPath, ref string desc)
{
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add(XmlSchema.Read(XmlReader.Create(xsdPath), Schema_ValidationEventHandler));
settings.ValidationType = ValidationType.Schema;
settings.ValidationEventHandler += new ValidationEventHandler(settings_ValidationEventHandler);
byte[] data = Encoding.ASCII.GetBytes(xml_string);
MemoryStream memStream = new MemoryStream(data);
XmlTextReader textReader = new XmlTextReader(memStream);
XmlReader rdr = XmlReader.Create(textReader, settings);
try
{
while (rdr.Read()) ;
}
catch (Exception e)
{
desc = e.Message;
rdr.Close();
}
return true;
}
|
|
|
|