|
That's pretty much it.
Const fields can only be used for types where there is a literal representation of the type, and the values are "burned into" the code that uses them.
Readonly fields can be used for any type, and the code that uses them references the constructed value at runtime.
|
|
|
|
|
Hi,
What is the best way to save an application and forms position (left & top) and size (width & height) so that when the user opens the app or form, it is displayed the same way it was last opened?
Is there a setting in .NET to accomplish this?
TIA,
Ben
|
|
|
|
|
Isn't that a Windows setting that user has control of ? I'm not sure if you can control it, but if so, it's likely one of the form properties.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
http://weblogs.asp.net/asmith/posts/3799.aspx
|
|
|
|
|
I have three combo boxes on a page. I have two tables, and have a dataset that access both of them. In the users table, I have an id, and an Employee name. The other table, inventory, stores references to these names, as well as supplies information. Now, the problem is, my combo box links to the employeeName, and sets that ID in the inventory table. With one combo box, this works fine. With two or more, what ever value you select in any combo box, will change all the other combo boxes to the same value. The reason for multiple combos, is I have fields in the inventory table, that record an employees name that signs a package in, and then another one for who is using it. Any suggestions? Would multiple dataSets be the solution?
|
|
|
|
|
Easy...
Combo.DataSource = Datatable.Copy();
|
|
|
|
|
This was asked on the DevelopMentor[^] lists not too long ago (02/25/03)... The solution as posted by Bob Beauchemin is to create a new binding context.
Current position in a DataSource is controlled by a CurrencyManager, which is associated with a DataSource/BindingContext pair. An application starts with a BindingContext per Form, controls inherit their parent's BindingContext.
Controls that have the same CurrencyManager (ie, same DataSource and same BindingContext) stay in sync. If you want controls that share the same DataSource NOT to stay in sync, you can allocate additional BindingContexts. This can be done for a group of controls through a common parent (ex. Panel) or on a per-control basis, ie.
dropdown1.DataSource = someds;
dropdown2.DataSource = someds;
// etc, binding other data properties
BindingContext bc = new BindingContext();
// don't want this dropdown synchronized
// if using same DataSource
dropdown2.BindingContext = bc;
Its a little heavy, but much better than making a copy of all of your data.
HTH,
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Hi!
Can you solve this problem?:
Do not loose SessionVariables when switching webapplications?
(I have a "FRAME" webapplication, which makes the authentication, menu,
and so on.
I wish to have more modules. These modules are optionally and i wont install all of them.
(possible way 1?)
I have my own SessionHandler wrapper, which can convert Requests into SessionVariables if it is neccessary. But, it seems to be a strange way. (not recommented, i think)
Problem:
i have more frames on clientside.
When i choose from menu (msiewebcontrols.TreeCtrl), i loose Session variables.
I fill up my menu from xml.(possible way?) so it is hard to encode runtime the xml.
so:
what about the same SessionHandleing in different webapplications?
Agyklon
|
|
|
|
|
How about just keeping it in a single web application? I have a portal, custom client area and web services running as one web application and it works fine that way.
Rocky Moore <><
|
|
|
|
|
Hm.
Right. But it isn't just a simple webapplication.
It has more independent functional modules.
(all of them separates bussinnes logic and userinterfaces.)
(some of them supports hardware handleing over ethernet or client side via COM1. The database structures are also different...etc...)
Do you know the way how to use
SessionStateServer service(in Sql mode), to solve this problem?
I don't want to write my own Sql sessionhandleing.
Is there a way to use stateservice from code?
Or there are some diffucilities, like sessionstate service guaranties the unique identifiers only by webapplications?
(and switching webapplication can couse an "identitiy conflict".)
AgyklonN
|
|
|
|
|
|
|
Hi,
I have a form with two buttons. In my form code am I able to override the form methods. But I cannot figure out how to override the Refresh method of the two buttons.
Here is what I am trying to accomplish
public override void Refresh()
{
this.Enabled = (cboCustomer.ToString() != "");
// "this" being the button itself
}
Thanks in advanced.
Ben
|
|
|
|
|
Valeria,
Thanks for your reply. I am sorry to be so dense on this, but still don't know how to implement.
One of the buttons I have was added to the form using the toolbox window.
public class SQLConnect : System.Windows.Forms.Form
{
...
private System.Windows.Forms.Button cmdConnect;
...
}
I have tried the to override the Refresh on the button with the following:
public void override cmdConnect.Refresh()
{
}
But c# does not like it.
Thanks for your help.
Ben
|
|
|
|
|
Valeria,
The reason is because I would like to set the "Enabled" property for that button based on a condition.
for example...
if (cboCustomer.ToString() == "")
this.Enabled = false;
else
this.Enabled = true;
Is there a better way (or best practice) to do this?
Thanks
|
|
|
|
|
Hi Friends !! I want to use splitter panel to make a ruler (like C++), but the position of main Panel is incorrect& scrollbar is incorrect, too ! why ? and how can I do ?
thank you !!
|
|
|
|
|
Hi!
I have such problem:
I wrote DLL which contains many controls, it always attached to solution like a single project. All works fine till I try to change version of my DLL in AssemblyInfo.cs file...
After change all form which use custom control in designer look strange. All custom controls disappeared and on Task window has many errors like this one:
Could not find type 'MenuItemEx'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.
All references in project are set well... Application start without any problems... but I loose opportunity to edit any form!!!! I can design it and after close and try to open again loose all control on form...
Does anyone can suggest how to fix this problem?
The main problem is that I can not change version number back... release of application was accomplished!!!
Good Luck
Alex Kucherenko
|
|
|
|
|
WiB wrote:
Clean completely bin folder in both projects.
This does not help. I'll try such solution at the beging...
Even More:
- i clean all forlder bin and obj
- i clean GAC
- I clean NGEN images
- at the end i search all instances of DLLs on my comuter and delete them... (in hidden folder too)
- I rebuild control library
- register it Designers part in GAC (needed for IDE)
and nothing good happens... I still got the same problem... I spend more then three days trying to solve problem in differ menner.
Good Luck
Alex Kucherenko
|
|
|
|
|
If your control library is strongly named (sounds like it is) then by default if the runtime can't find that specific version number it will fail to load. To get around this you can include a publisher policy which tells the runtime that when version a.b.c.y (or a range of versions) is asked for to use version w.x.y.z. You can also use a configuration file which does the same thing, but requires that whoever controls the .exe put some entries in the .exe.config file.
Publisher Policy Sample[^] by Mike Woodring.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
I have a lot of description to write for each property in a property grid. My problem is that I don't see any methods to make the description pane (or help pane) higher.
Is it possible to set a new height for the description pane in a property grid ?
Thanks for your help !
Nico
|
|
|
|
|
nico193 wrote:
Is it possible to set a new height for the description pane in a property grid ?
Nope. That's a function of the IDE, not your code.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
I don't think he means the one in the IDE. I think he means his own property grid.
"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
|
|
|
|
|
Could be... *David drinks more caffeine*
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Yes, I mean the description pane in a propertygrid (windows Forms).
|
|
|
|
|