|
Hi All,
Say there are "Green, Helen, Kate, Kevin, Peter, Smith, White, Venu, Zac" loaded into ComboBox. When a user types "K" in the CombBox, which ComboBox method should i use in C# to make the items in this ComboBox auto jumpted to "Kate and Kevin", and even more when the user types "Ka", how can i make the "Kate" highlighted?
Thanks heaps
|
|
|
|
|
Hi,
there is FindString (and FindStringExact) to locate an item by its starting or full text; but these would not reduce the list shown. AFAIK to get that, you would have to code things yourself.
|
|
|
|
|
you can use TextChange event of ComboBox, btw when you write something in CB and drop the list, it automatically selects the top one that StartsWith the Text of CB.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi
I'm writing a web app to upload up to 4 images to a folder. I also have a drop-down list so the user can choose whether pic is picture 1, 2, 3 or 4 (to set order on page display). Anyway, when one picture is uploaded the user stays in the form to add more pictures. I clear the DDL and re-populate it depending on which pictures have already been uploaded - i.e if pic 1 has been uploaded, only pic 2, 3 and 4 appear in drop-down. To determine this I use File.Exists but this doesn't seem to be working on a postback (i.e it doesn't find pic1.jpg which I have uploaded. It works however, if I leave the page and then click to add an image later - could this be an issue of the folder not refreshing so it looks like the file doesn't exist or a postback problem? Any ideas would be greatly appreciated.
Thanks
Lorna
|
|
|
|
|
Member 3402886 wrote: I'm writing a web app
This is C# Forum. Please post it to ASP.NET Fourm
Thanks !!
|
|
|
|
|
OK will do, but I am using c# code to do this!
|
|
|
|
|
The launguage you use to write ASP.NET applications doesn't matter. Your question falls squarely within the perview of ASP.NET technologies. It has nothing to do with C# at all.
|
|
|
|
|
hello all
what is the technique behind the implementing an option like recent files for a window application in c#....
the last 5 projects to be shown always and it must be open when user clicks for it... same as in Visual studio.NET
|
|
|
|
|
You write code so that you call each time you open a file. This code takes the filename of the file and you store the filename somewhere. When you display the menu that shows the last few files opened to retrieve the information you previously stored.
Where you store that information is up to you. You may decide an XML file works best, maybe in the registry, maybe a database (if you are already using one) or something else.
|
|
|
|
|
|
dude, i dont think its a good idea to write files info in registry. It will keep there even if you remove the app or you also need to code when uninstalling and so...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
some think otherwise, see e.g.
HKEY_CURRENT_USER\Software\Microsoft\MSDN\9.0\WebBrowser\MRU
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\File MRU
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\PowerPoint\File MRU
HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\FileMRUList
and where ever you put it, you will have to clean up upon removal.
|
|
|
|
|
mate, these softwares get remove but they dont remove their info from reg. thats why system startup keep slow even you uninstall the soft, isnt it ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
how to export Windows Registry information to .REG file using c#.net?
thanks in advance
|
|
|
|
|
You can write a bat file which export registry to reg file and call it from your program. Or you can just call reg.exe from your program directly.
|
|
|
|
|
For example I create a string variable as follows:
string strNumber = "123";
To convert it into integer data type which is better option and whats the differnce between these options.
a) Convert.ToInt32(strNumber);
b) int.Parse(strNumber);
Software Development & Web Development is my addiction. I am a Visual C# 2.0 and ASP.NET 2.0 Developer and working in Visual Studio 2005 using Dot Net Framework 2.0.
Email: bottomless.wisdom@hotmail.com
Web: http://bottomless-wisdom.spaces.live.com
modified on Monday, December 8, 2008 2:23 PM
|
|
|
|
|
Hi,
The documentation is your friend!
The docs for Convert.ToInt32(string) state:
The return value is the result of invoking the Int32.Parse method on value.
AlanN
|
|
|
|
|
Like Alan says - No difference.
The best option for converting from string to int though is the Int.TryParse() method. It returns false if the parse failed rather than throwing an exception like the other ways do.
Simon
|
|
|
|
|
More often than not, I've found that I need the exception thrown if only to avoid executing code that cannot proceed without a valid conversion.
I guess that means that you use the technique that best fits the situation/requirements.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
All right all right , use the method best suited and all that, depends what you are doing etc etc....
I just find I use TryParse followed by an if check much more often than Parse, but maybe that's just me.
Simon
|
|
|
|
|
The difference between using TryParse and Parse is that if you expect that it will fail (e.g. you are using it to validate and convert user input) then you should use TryParse . If you expect that it will always work then use Parse (e.g. you are parsing a value from an XML file where the schema says it is an integer).
|
|
|
|
|
I generally use this format for all the conversions, I never use Convert any more as I think it is just more lines of code than are necessary:
int num = 0;
string hold = "123";
if(!Int32.TryParse(hold, out num))
{
}
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Simon Stevens wrote: Like Alan says - No difference.
For this case yes, but be careful with the overload taking an object as the following will show you:
Convert.ToInt32(false) => 0
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I generally avoid Convert.
|
|
|
|
|
if strNumber is null, Int23.Parse throws an exception while Convert.ToInt32 returns 0.
|
|
|
|