|
Hi sir,
When i type in combo edit box any character,i am find the character typed with the string.
Its all working fine.
But the problem i am facing is
1) When i select any value from the dropdown combo,
the value is not setting to
edit box combo,as the dropdown is showing again
2)After getting the dropdown list,if i tried to select the
value from keyboard "i.e by pressing down key arrow",
the value is not setting and i am getting empty value in edit box.
Here is the code ,i am trying with
private void comboBox1_TextChanged(object sender, EventArgs e)
{
int j = 0;
string str,strTemp,str1;
str = comboBox1.Text;
comboBox1.Items.Clear();
for (int i = 0; i < List.Count; i++)
{
j++;
string value = List[i] as string;
str1 = value.ToUpper();
strTemp = str.ToUpper();
if (str1.IndexOf(strTemp) != -1)
{
j++;
comboBox1.Items.Add(value);
}
}
int k = str.Length;
comboBox1.Select(k, k++);
comboBox1.DroppedDown = true;
}
As i am new to C#.I am confused a bit.
Any idea will be really helpful
Thanks
Raj
|
|
|
|
|
I think that using comboBox1.Items.Clear(); is not a correct thing to do (it messes up all you selected items and so on).
All your code can be replaced (if you use .net 2 or greater) with the functionality of the autocomplete[^] feature.
I have no smart signature yet...
|
|
|
|
|
Hi sir,
Thanks a lott,its working fine now.
Thanks
Raj
|
|
|
|
|
Hello.
I am creating two application in C# one is for send message to another IP of my LAN. One that given IP i have another application in C# which is to receive that Message.
I am using Socket Programming but getting error
Doing like this...
http://www.c-sharpcorner.com/uploadfile/dottys/socketprogdtrp11222005023030am/socketprogdtrp.aspx
suggest me...
shafiq
|
|
|
|
|
Judging by the responses to that article, I'd run fast and far from that site. I appears to be populated by idiots.
First off, at least tell us what error you're getting from your code. It's very likely that someone here has already seen the same message and knows what it takes to fix it. If not, at least it will provide a clue to the solution. "getting error" tells us nothing.
Secondly, spend some time browsing the articles here at CodeProject about socket communications. The articles here are written by professionals, are peer-reviewed, and cover a vast array of different approaches and solutions to common and unique problems. You will very likely find the solution simply by comparing your code to something already posted here.
Good luck!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hey Roger Wright..
Thnk for relpy, actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine.
So i copied and paste that article code.
But getting error........
Only one usage of each socket address (protocol/network address/port) is normally permitted.
Regards...
Shafiq
|
|
|
|
|
Shafiq4Code wrote: actually i dont have any knowledge about how to send data from one application to another over LAN or another application on same machine.
May I suggest you spend some time learning the subject before trying to implement some code that you cannot understand. There are many articles here on CodeProject that will give good explanations as well as source code. There are also lots of good learning resources on the internet that you should be able to find via Google.
It's time for a new signature.
|
|
|
|
|
Thanks for reply
Can u please suggest me what thing i need to learn to accomplish this.
|
|
|
|
|
The .NET Sockets[^] class is a good starting point. As I said before you should look at some of the networking articles here on CodeProject, there are some excellent examples which contain both code and explanations.
It's time for a new signature.
|
|
|
|
|
Check this article [^] at MSDN for details about the TCPClient class, and browse the related links for more information. The code you copied uses port 10 on both computers; since ports 0 - 1023 are Well Known Ports defined by IANA here[^], you should avoid them. It's possible that on one or both machines, port 10 is already in use. The combination of IP address and port may only be used once per machine. The IANA link also defines which port numbers are available for general use. Pick your port numbers from that list.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi All.
I am planning to develop a Screen Capture application using FFMpeg. Can someone help me out if there are any good .NET Wrappers that allow Screen Capture. I browsed through the net and found SharpFFMPeg and SolidFFMpeg to be some good .NET Wrappers for FFMpeg but I am not quite sure if they can do Screen Capture as FFMpeg.
Thanks in advance.
Cheers,
Sridhar
|
|
|
|
|
On googling I found this[^] Wrapper. Try it out...
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
i m trying to fill the combo box with the data from the access database but i m getting the error
"Object reference not set to an instance of an object."
i m writing the following code for the purpose
con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=practicedatabase.accdb");
con.Open();
string qry = "Select * from cat_table";
dadapter = new OleDbDataAdapter(qry, con);
dset = new DataSet();
DataTable dt = new DataTable("cat_table");
dadapter.Fill(dt);
this.comboBox1.DataSource = dt;
this.comboBox1.DisplayMember = dt.Columns[1].ColumnName;
|
|
|
|
|
Trace & check the value dt.Columns[1].ColumnName at the following line
this.comboBox1.DisplayMember = dt.Columns[1].ColumnName;
Sample Code
comboBox1.DataSource = dt;
comboBox1.DisplayMember = "Cat_Name";
|
|
|
|
|
but it still giving the same error
|
|
|
|
|
I have a default directory saved in my app.config and also another directory.
In the options of my program the user is supposed to be able to change the other directory or restore the default.
Yet, that doesn't seem to work properly.
At program start (first time) default and other directory have the same value. In the options I use a FolderBrowseDialog and then display the SelectedPath in a textbox. When the user clicks apply/ok the value of said textbox is written into the app.config (presumably).
Yet, when opening another form to use that changed directory (I double and triple checked for spelling mistakes), the default directory is still used.
I checked the .exe.config and .vshost.exe.config files in the debug folder, yet they, too remain unchanged after changing the directory.
But when I read the config value during runtime with config.AppSettings.Settings["elementPath"].Value , the value is the changed one as long as I stay on the same form I changed it on.
Why does that happen?
Thanks.
|
|
|
|
|
|
Hi forum
I´m doing a class who inherits from usercontrol.
In my application a have a form and a property grid.
when the property grid shows the 'properties of my class' also shows all properties of usercontrol, but i only want to show the properties of my class.
In my class i only have 3 properties. I dont want see the properties of usercontrol, only my 3 properties.
How can i do it?
Thank you
|
|
|
|
|
Use the Browsable[^] attribute on an overridden or new property, e.g.
[Browsable(false)]
public override Color BackColor
{
get { return base.BackColor; }
set { base.BackColor = value; }
}
}
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hello.
Thanks for the answer, but for me is illogical to hide all properties throught the attribute 'browsable'. So it indicate that i have to hide every property, one by one.
there is any way to show only the properties of my class with out hide one by one the properties.
|
|
|
|
|
No, you have to do it one by one I'm afraid. I know it sucks but that's the downside of inhertance. It would be nice if MS had made a ControlBase class with minimal properties and methods so this wasn't necessary.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
See Hiding inherited properties[^]
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Hi friends.
I'm trying to create FTP Sever with socket programing.I know how to transfer files between server and client but i don't know how to browse server's folders in client.It is possible to use FolderBrowserDialog?
|
|
|
|
|
Hi , I would be happy to help you
I was using FTP software and they are all have something like commands ,
LS to list the names of the files in the current remote directory
lcd to change directory on your local machine
kind regards
I know nothing , I know nothing ...
|
|
|
|
|
Hi dear friend.Can you explain more than about LS and LCD commands.I need graphically browsing in client side.
|
|
|
|