|
Hi,
I need to have a combo box with a lot of elements ( like 200, or maybe 400 elements), what I wnat to do is that the user type the name and it goes showing the most similar matches ( something like VStudio net makes, but no need for strange control just in a combo it's ok).
Is there someway to do that ? or Should I implement a new control ?, Greetings
Braulio
|
|
|
|
|
the combobox when set to a droplist (cannot type in it) will automatically go to an item which begins with the character the user presses.. example: you press 'h', and it moves to the first item begining with 'h', hit 'h' again and it goes to the next one, etc..
as for the functionality you are looking for i have not seen anything like that.. your best bet would be adding a message handler for when a key is pressed in the combobox, and doing a BeginsWith() search with what they have typed in, if you find something then set the combobox selection to that item.. the problem is keeping the submenu expanded while they are typing.. i have no clue on the actual implementation, but im pretty sure its not built in..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hi,
I've found some interesting code snippet for that autocomplete, but I think it doesn't show the list meanwhile you are typing
I found this code somewhere.
[code]
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Me.ComboBox1.Text = ""
Me.ComboBox1.Items.Add("a")
Me.ComboBox1.Items.Add("aaa")
Me.ComboBox1.Items.Add("combo")
Me.ComboBox1.Items.Add("combobox")
Me.ComboBox1.Items.Add("combobox test")
Me.ComboBox1.Items.Add("common")
Me.ComboBox1.Items.Add("common dialog")
End Sub
Private Sub ComboBox1_KeyUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.KeyEventArgs) Handles
ComboBox1.KeyUp
Dim index As Integer
Dim actual As String
Dim found As String
' Do nothing for some keys such as navigation keys.
If ((e.KeyCode = Keys.Back) Or _
(e.KeyCode = Keys.Left) Or _
(e.KeyCode = Keys.Right) Or _
(e.KeyCode = Keys.Up) Or _
(e.KeyCode = Keys.Delete) Or _
(e.KeyCode = Keys.Down) Or _
(e.KeyCode = Keys.PageUp) Or _
(e.KeyCode = Keys.PageDown) Or _
(e.KeyCode = Keys.Home) Or _
(e.KeyCode = Keys.End)) Then
Return
End If
' Store the actual text that has been typed.
actual = Me.ComboBox1.Text
' Find the first match for the typed value.s
index = Me.ComboBox1.FindString(actual)
' Get the text of the first match.
If (index > -1) Then
found = Me.ComboBox1.Items(index).ToString()
' Select this item from the list.
Me.ComboBox1.SelectedIndex = index
' Select the portion of the text that was
automatically
' added so that additional typing will replace
it.
Me.ComboBox1.SelectionStart = actual.Length
Me.ComboBox1.SelectionLength = found.Length
End If
End Sub
[/code]
|
|
|
|
|
There is something with Internet explorer 5.5, there is a DLL, that has that kind of control ( that cool combos stuff comboboxEx), now I have to study, how to use it in C#...
|
|
|
|
|
|
if you add a new class entity and then assign an object to it in the constructor.
public class MyClass
{
private SolidBrush sb;
public MyClass(Color brushcolor)
{
this.sb = new SolidBrush(brushcolor);
}
This will set the brush colours during instantiation.
"I have a strange ginger man living on my roof!"
"...does PHP need templates? I don't think so because PHP's data is loosely typed. It couldn't care less if the data was about strings or potato fritters." -John Lim
Jonathan 'nonny' Newman
Homepage [www.nonny.com] [^]
|
|
|
|
|
AFAIK it is the only way you can create a brush object at instantiation that can be accessible to OnPaint.
"I have a strange ginger man living on my roof!"
"...does PHP need templates? I don't think so because PHP's data is loosely typed. It couldn't care less if the data was about strings or potato fritters." -John Lim
Jonathan 'nonny' Newman
Homepage [www.nonny.com] [^]
|
|
|
|
|
As I'm about to do in my project, I think it's better to make pens and brushes member variables -- or in my case, static variables because the same brush can be used across all instantiations -- so you don't have to constantly construct and dispose brushes in the OnPaint method.
|
|
|
|
|
You can, but make sure you call dispose on them at the end of the method, else it with quick swallow all your RAM.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi leppie,
I have a question about that that I simply can't find a simple answer to in the MSDN documentation.
If I create a pen, brush, etc., in the OnPaint event, do I need to manually displose of it before exiting the OnPaint event?
Thanks!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Marc Clifton wrote:
If I create a pen, brush, etc., in the OnPaint event, do I need to manually displose of it before exiting the OnPaint event?
Preferably! The GC will dispose them eventually. Have a look in task manager to see if extra handles are continuously created.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Nice to meet you !
I have simple question ...
I have experience for develop SNMP Manager in UNIX system using by C,tcl...
in that case, using UCD-SNMP ...
Now I do want develop SNMP Manager in WindowsXP using by C#.
(Microsoft Visual Studio .NET)
in this case , what can i do ?
is it support snmplib or any kinds of extension in C# ?
==============================
Name : B.S. Yoon
mail to : bsyoon@mercurykr.com
==============================
|
|
|
|
|
hi,
i have already written a class using the wsnmp32.dll api. if you want to have it , please e-mail me..
Doing something is better than doing nothing. So ... Move !
|
|
|
|
|
Thanks your kindly answer !!
If it is possible , Can you send to me wsnmp32.dll api and
can you let me know more than detail for using wsnmp32.dll !
This is first time for develop windows programing...
i hope your kindly support !!
my email address : bsyoon@mercurykr.com
==============================
Name : B.S. Yoon
mail to : bsyoon@mercurykr.com
==============================
|
|
|
|
|
check your e-mail box , please
Doing something is better than doing nothing. So ... Move !
|
|
|
|
|
Thanks your kindly answer !!
also, I get your snmp project file..
when i degug your project file, your source is needed DB (mdb)
"D:\MyPrograms\VbNet\C\OidTables\OidTable.mdb;"
38 line in "ClsOidTable.cs"
but i don't have and Don't know that Configuration for "OidTable.mdb"
can i receive OidTable.mdb file?
==============================
Name : B.S. Yoon
mail to : bsyoon@mercurykr.com
==============================
|
|
|
|
|
Sure...
Check your e-mail box , please. i've already sent it
Doing something is better than doing nothing. So ... Move !
|
|
|
|
|
Is there some handy package or library that someone can recommend for handling automatic or semi-automatic updates. Essentially, it would periodically check to see if there's an updated version of a package or library and then install it. Ideally it would be seamless to the user and would allow updating only the changed files and not require downloading an installer everytime.
Any suggestions? ZeroG.com has something called PowerUpdate which is similar, but I'd rather have something that is free and in my own control.
Thanks,
Arun
|
|
|
|
|
There is a component on GetDotNet that does just that.
NET Application Updater
Bo Hunter
|
|
|
|
|
It looks interesting... and there's source available, which is nice. Thanks!
I welcome any other suggestions...
|
|
|
|
|
I have written the user control similar to Outlook bar, written in C#. I want to browse items( Images and strings as in Outlook bar) in the same at design time and want those to persist run time. Right now I have provided collection editor class for this. Due to collection editor class I am able to add items at design time, I am able to see those items in my control which is placed on the client form, but the added items are not seen on the control when I run my application. Also "AddRange" statement for user control is not added in the "InitializeComponent" function of my client form. I have also tried a typeconverter for my user control but no effect. Please help.
|
|
|
|
|
|
Okay, before I start, this may be really simple to remedy, but I haven't spotted it yet, so here goes.
I'd like to use a control in my C# application that:
1 - looks like a normal list view control in large icon mode (so plain white, large icons with labels)
2 - Allows the user to position icons arbitrarily within the control (so no alignment, but a track kept of where each one is)
Basic idea is hopefully going to end up like moving flowchart elements in Visio, or in the old versions of Rational Rose. I'm going to eventually want to join them together with flow lines.
Now, as far as I remember, ListViews in Windows Explorer allow these abilities. I can place my folder icons all over the place sometimes, and they don't have to snap to grid or anything. Am I just missing the right settings in the control properties? I can get it to show the icons, but it won't let me drag them to a new position within the control (gives me a no-go pointer even though AllowDrop is set to true).
Any help is much appreciated.
Cheers
Phaedrus
|
|
|
|
|
For Example,current Form?
Future belongs to C#!
|
|
|
|
|
Only thing I can think of is Capture Screen. But that will capture the whole screen.
Bo Hunter
|
|
|
|