|
The standard ComboBox has always had this ability as long as Windows have had ComboBoxes. In fact, it is the default behavior.
The ComboBox has a property called DropDownStyle. Options are Simple, DropDown, and DropDownList. Simple makes it act like a TextBox, DropDownList restrict it to a DropDownList only (no typing in the box), and DropDown has both the Dropdown, and text edit.
Since you believe it is not already present, I wonder if what you really want is for the text entered by the user to be added to the dropdown list? If so, you would need to add code to do this. I would recommend having an "Add" button, which would add the value of ComboBox1.text to ComboBox1.items (with some code to make sure that the item is not already in the list).
Roy.
|
|
|
|
|
Ok yeah that is true, sorry but i probably should have been more explicit in what i was looking for. What i forgot to mention is that i'm working on a web project so thats why i can't use the ComboBox youre suggesting. So what i'm looking for is a way to change a the webcontrol DropDownList to behave like a standard WinForm ComboBox.
Thanks for youre replies though.
Henrik
|
|
|
|
|
I read that ulong is not CLS compliant, but this code compiles cleanly on .NET 2.0. Any idea why? Was my source wrong?
using System;
[assembly:CLSCompliant(true)]
namespace CustomAttributes
{
[CLSCompliant(true)]
public class MarutiZen
{
decimal price;
public ulong MyULong;
public MarutiZen()
{
}
}
}
Thanks in advance.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Vikram A Punathambekar wrote: using System;[assembly:CLSCompliant(true)]namespace CustomAttributes{ [CLSCompliant(true)] public class MarutiZen { decimal price; public ulong MyULong; public MarutiZen() { } }}
I get a compiler warning saying, "Type of 'TestingApp.Form1.MarutiZen.MyULong' is not CLS-compliant".
|
|
|
|
|
Thanks, Judah. Ok, I didn't look carefully enough. There's indeed a warning, but the documentation says I should get an error.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Hmm. Maybe if you turn on "warnings as errors"? Sometimes MSDN doco isn't quite on top of things, so it seems.
|
|
|
|
|
Judah Himango wrote: Maybe if you turn on "warnings as errors"?
Yup, I know about that flag, but then the documentation should say "...you will get a warning, which you can promote to an error with a compiler flag".
Judah Himango wrote: Sometimes MSDN doco isn't quite on top of things, so it seems.
Sadly, I was referring to Troelsen. A quick search on Google for ulong clscompliant generates tons of results. Yet....
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
I'm passing a format string to do the truncation. It's not always working though. THe first problem is that for 0<d<1 it="" does="" not="" put="" a="" leading="" zero,="" which="" is="" cosmetic="" annoyance.="" more="" seriously="" though="" for="" d="0," returns="" ""="" "0"="" or="" "0.0".="" the="" same="" thing="" happens="" d<.0001,="" should="" be="" truncated="" to="" 0.
is="" there="" different="" charater="" i="" can="" pass="" that="" will="" return="" zero="" instead="" of="" null?="" i'd="" prefer="" do="" my="" rounding="" truncation="" during="" output="" rather="" than="" artimatically="" and="" gamble="" any="" remaining="" error="" remains="" small="" enough="" default="" tostring()="" eats="" every="" time.
<code="">
d = 0.001;
s = d.ToString();
s= d.ToString("########.####");
d = 0.000001;
s = d.ToString();
s= d.ToString("########.####");
double d = 0.0;
s = d.ToString();
s= d.ToString("########.####");
|
|
|
|
|
Dan,
If you want a leading 0 to appear ONLY when the double's integer part is 0, put a 0 between the last hash in the integer part and the decimal point.
double d;
string s;
d = 0.001;
s = d.ToString();
Console.WriteLine(s);
s= d.ToString("########0.####");
Console.WriteLine(s);
produces the output
0.001
0.001
For the special case of 0.0, you will have to add an extra zero between the decimal point and the first hash of the fractional part. Your format string now looks like
"########0.0####"
Now, the output of
using System;
class Foo
{
public static int Main(string[] args)
{
double d;
string s;
d = 0.120;
s= d.ToString("########0.0####");
Console.WriteLine(s);
d = 0.0;
s= d.ToString("########0.0####");
Console.WriteLine(s);
return 0;
}
}
will be
0.12
0.0
I hope that answers your question, and thanks for making me learn something today. However, please check the code yourself because it's 8:45 PM here and I did this in a hurry.
PS: Let me know if I was right.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Vikram A Punathambekar wrote: I hope that answers your question, and thanks for making me learn something today. However, please check the code yourself because it's 8:45 PM here and I did this in a hurry.
PS: Let me know if I was right.
This appears to be doing everything I need. Thank you.
PS did you trial and error this, or find something explaining it online? I tried googling last week, but could only find the predefined, 'named' format strings and a single example with the ###.### format, but not any of the other control chars used in formatting.
|
|
|
|
|
dan neely wrote: did you trial and error this, or find something explaining it online?
Trial and error. My first try was to put a leading zero. Unfortunately, it returned numbers like 023.4, so I tried putting it at the end. Voila! After that, it didn't take too many brain cycles to figure out I should put a zero after the decimal point for the fractional part.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
This one has confounded me, so I guess I'm not putting the correct terms into the search engine.
We have recently upgraded a server from Windows 2000 to Windows 2003 Advanced Server. After the initial problems of getting ASP.NET working under the new improved security model the problems continue.
Part of the system sends batch jobs off to the Windows Task Scheduler. Some jobs are running okay (but they are not .NET applications), however all the .NET applications seem to be having problems running through the task scheduler. The first sign of a problem was one application that failed instantly before it even got as far as creating its log file (which is more or less the first thing each of these applications do). Other jobs just sat in the task scheduler with a status of running. (I should add that they also should have failed instantly becuase I tell it to use an input file that doesn't exist, but they should have produced a log file) Meanwhile the Event Log had two error messages:
The application-specific permission settings do not grant Local Activation permission for
the COM Server application with CLSID {73B25FFD-F501-437B-8B11-7F0DE383964F} to the user
DOMAIN\user_account SID (S-x-x-xx-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxx).
This security permission can be modified using the Component Services administrative tool. After some searching on the internet I found that it refers to the Debugger. So I added the user to the Debuggers group. And now all I get is one information message in the event log.
Application popup: JIT Debugging :
JIT Debugging failed with the following error: 0x800405a6
Please check the documentation topic 'Just-in-time debugging errors' for more information. Well, the problem is that I cannot find a document that refers to .NET 1.1. I did find some blogs and forum posts that bemoaning the fact that the documentation was crap.
Does anyone have any ideas?
Summary:
Migration from Windows 2000 Server to Windows 2003 Advanced Server
.NET 1.1
The server also acts as a domain controller
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
-- modified at 9:47 Tuesday 21st February, 2006
|
|
|
|
|
I can successfully capture the ENTER key that a user presses in a combo box, but my desktop always plays a "ding" when the ENTER key is pressed - as if the key is not valid in the context of a combo box. Does anyone know how to prevent this annoying ding from being played?
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
how to pass a textbox value into the report in c#
|
|
|
|
|
What report?
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Do you mean the text inside the textbox? If this is the case, use TextBox.Text property.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
yes. how to match the textbox value with an sql expression field ?
|
|
|
|
|
What exactly do you mean? Build an SQL query using the value from a TextBox??
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
hai guys i want text message to be scrolling on in my form from one end to the other.this is c# windows application. pls give me the solution.
|
|
|
|
|
You could use a timer and at different times, draw the text message at a different location on the form. With a little thought and research into timers and drawing text this should be easy to figure out.
Deus caritas est
|
|
|
|
|
Hi
I’m trying to view a crystal report on web but no luck. I can load the report I just can see it on the browser. Please tell what I’m doing wrong and how to fix it. her is my code:
public Report(string ReportPath, string RepID)
{
string ReportName = string.Format("{0}\\{1}.rpt", ReportPath, RepID);
ReportId = RepID;
myReport.Load(ReportName);
}
public void SetSelection( string RepSelection)
{
myReport.RecordSelectionFormula = RepSelection;
}
public void ExportRepHTML(string ExportingPath)
{
string FullExportingPath = string.Format("{0}\\{1}.htm", ExportingPath, ReportId);
// Declare variables and get the export options.
HTMLFormatOptions HtmlOpt = ExportOptions.CreateHTMLFormatOptions ();
ExportOptions ExpFtmOpt =new ExportOptions();
DiskFileDestinationOptions diskOpts =new DiskFileDestinationOptions();
HtmlOpt.HTMLFileName = FullExportingPath;
HtmlOpt.HTMLBaseFolderName = "D:\\Crystalreports\\Theslectionofreports";
HtmlOpt.HTMLEnableSeparatedPages = true;
HtmlOpt.HTMLHasPageNavigator = true;
// Set the export format.
ExpFtmOpt.ExportFormatOptions = HtmlOpt;
diskOpts.DiskFileName = FullExportingPath;
ExpFtmOpt.ExportFormatType = ExportFormatType.HTML40;
ExpFtmOpt.ExportDestinationType = ExportDestinationType.DiskFile;
ExpFtmOpt.DestinationOptions =diskOpts;
// Export the report.
myReport.Export(ExpFtmOpt);
}
}
}
Thanx
|
|
|
|
|
hi all
How can i access soap protocal over the internet using sql database
Let say i am using web service
I want someone to help me
I need pdfs and code sample or site
|
|
|
|
|
Your question is not clear, please rephrase it.
|
|
|
|
|
let say i am developing a software that work over the internet
let say i am in ghana the server is in london
how can i access the server in london
if am using web service
i think is clear
i need pdfs and some sample code
|
|
|
|
|
Hi,
In my project, i need to read Sanskrit language sentence from the textbox, even i need to do some opearations on words in that sentence.
How can i read a Sanskrit sentense from textbox, pls tell me?..
Its very important for my project
Waiting 4 ur reply
Cheers
Shiva
|
|
|
|