|
How do you mean ? It is deactivated, it won't respond while a modal dialog exists above it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think "Form.ShowDialog()" is what you are looking for.
Hope this helps.
Bikash Rai
|
|
|
|
|
I'm wrestling with the new Windows Forms data binding in .Net 2.0 without much luck.
Here's my data binding source object:
public class UserCredentials<br />
{<br />
#region Fields<br />
<br />
private string userName;<br />
private string password;<br />
<br />
#endregion<br />
<br />
#region Properties<br />
<br />
public string UserName<br />
{<br />
get { return userName; }<br />
set { userName = value; }<br />
}<br />
<br />
public string Password<br />
{<br />
get { return password; }<br />
set { password = value; }<br />
}<br />
<br />
#endregion<br />
}
I then create a simple Form with TextBoxes for the user name and password, and bind the Text property to the relevant properties in my binding source. I also have some simple validation code to check that data has been entered, and have provided a Cancel button on the Form so the user can back out of any changes made.
In the form's constructor I set the DataSource property of the BindingSource to an instance of the UserCredentials class. So far so good, the UserName and Password properties of the UserCredentials class are binding to my two TextBoxes just fine.
The problem is, I can't find any way to roll-back the changes made to my UserCredentials instance if validation fails, or the user clicks Cancel.
I'm sure it's very simple, but I just can't see it right now.. Any ideas?
|
|
|
|
|
use a BindingManagerBase object to send the values back to the data source
unfortunately, its only set up for a dataViewRow objects.
But if you extend the BindingManagerBase and a few other classes you can get there
I believe the class you need to get to is ContextManager which has the refresh method to create your own deriving it from BinidingManagerBase.
Its been a year since I did that. But, it rocks when your done.
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Hrmm, are you sure you're talking about .Net 2.0 object data binding?
It would be much easier just to Set/Get the Text properties of a couple of TextBox controls than go to that level of work.
I was really hoping the data binding in .Net 2.0 was an improvemnt over the 1.0 stuff
|
|
|
|
|
You need to implement IEditableObjectinterface.
And write code to BeginEdit, EndEdit and CancelEdit
You can check CSLA Framework on Internet to check how implement IEditableObject interface
Regards
|
|
|
|
|
Thanks bismark, that of course worked.
After seeing all the improvements to data binding during design time, I had hoped the powers that be had built a better mousetrap for object binding in V2.0, but not so hey.
|
|
|
|
|
Is there a way to zoom an image quickly that doesn't make it all fuzzy like using drawImage does. (I'm making a paint like program and I would like the pixels to stay rectangular as you zoom in). thnx
|
|
|
|
|
use the directx libraries for that type of effeciency
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
bobisreallycool wrote: Is there a way to zoom an image quickly that doesn't make it all fuzzy like using drawImage does.
You can't zoom into an image without losing quality.
bobisreallycool wrote: (I'm making a paint like program and I would like the pixels to stay rectangular as you zoom in).
Pixels are not quite rectangular, but you can keep them correctly drawn by making sure you zoom to a correct aspect ratio.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need an example in c# with a timer.
I never has program in this lenguage .
Soy estudiante de 4to año de Informatica
|
|
|
|
|
Rosayne wrote: need an example in c# with a timer.
Google 'C# timer'
Rosayne wrote: I never has program in this lenguage .
What languages have you programmed in ? If none, then you should not worry about timers just yet, IMO.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
is so easy.
please write me to my personal email, I can help you... inclusive in Spanish.
|
|
|
|
|
Hi friends,
the follow code will be run normally in WindowsApplication:
string userName = "a";
string userPass = "a";
string address = "192.168.18.145";
int port = 8080;
WebProxy myproxy = new WebProxy(address , port);
NetworkCredential credentials = new NetworkCredential(userName, userPass, null);
myproxy.Credentials = credentials;
WebRequest rqt = WebRequest.Create(this.textBox2.Text.Trim());
rqt.Proxy = myproxy;
rqt.PreAuthenticate = true;
WebResponse rsp = rqt.GetResponse();
System.IO.Stream stream = rsp.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
this.textBox1.Text = reader.ReadToEnd();
stream.Close();
reader.Close();
but in the SmartDeviceApplication,,it will cause the problem :
The response did not contain an end of entity mark.
Can you tell me why and how to solve the problem??
Thank you !!
22
|
|
|
|
|
|
WebResponse rsp = rqt.GetResponse();
this line.....
|
|
|
|
|
Judging by the rest of your code, the site you are accessing is something else you've written? If so it looks like that code is sending back an invalid web response.
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
I think all the thing I have written....
Can you write a example of proxy with credential in SmartDeviceApplication for me??
thank you !!
|
|
|
|
|
I haven't played with this before so I can't send you any good samples. AFAIK though your client code looks correct. I think that the server/website you are accessing is sending back an invalidly formated HTML page
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
|
I Have a class (not a usercontrol) in a seperate assembly that I need to implement licensing on.
I'd like it to do the following and i'm not sure if this is possible.
a) I'd like to not use LIC files, but instead use a RegistryLicenseProvider which gets a certain key/value from the registry and sees if this is valid. I already have this part in my 'GetLicense' function in my derived LicenseProvider.
b) Developer installs package which creates registry key for RegistryLicenseprovider
which denote that this is a valid 'developer' license. For testing purposes I simply created a registry key with the value 'test'.
now the issue comes in the next steps - it should work like this:
c) When compiling the main exe, the license info gets picked up and embedded as runtime license in the exe
d) Client runs fine without this registry key because if it can't find the registry key it finds it embedded in the exe.
This is how i understand the standard LicFileLicenseProvider to work. Is this correct?
Currently the program runs, but as soon as I delete the registry key the program stops working so obviously nothing is getting embedded. I Had to create my own license.licx file and added it to the project as embedded resource too.
So instead of design time I'd almost need compile time licensing.
What am I forgetting or is this just not possible and should I just forget about this?
Do i need to write my own code that somehow gets the embedded licenses from the calling application?
Thanks
|
|
|
|
|
Side Note: I built the registrylicenseprovider like the one mentioned here:
http://www.codeguru.com/Csharp/.NET/net_framework/licensing/article.php/c5469/
|
|
|
|
|
Hello,
how can i create an array of followig struct:
struct CCDtype
{
double breite;
double höhe;
string btext;
// Konstruktor der Struktur
public CCDtype(double para1, double para2, string para3 )
{ this.breite=para1;
this.höhe =para2;
this.btext =para3;
}
} ;
I want to initialize it via constructor something like this:
private CCDtype[1] = new CCDtype[] (5.0, 3.7, "1/3\" ( 5.0 x 3.7 mm)");
The Array should be a static member of the struct!
thanks a lot
Daniel
|
|
|
|
|
Try this:
private CCDtype[1] = new CCDtype[] ( new CCDType(5.0, 3.7, "1/3\" ( 5.0 x 3.7 mm)"));
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian,
If I try this, SharpDevelop says "SyntaxError "]" expected. There is something wrong with the empty bracket?
Could you explain me the background of using 2x new pleace?
Daniel
|
|
|
|