|
i have listBox with multi coulm
how can add control to item 1 in col 2 ??
control as comboBox
Palestine
|
|
|
|
|
A listbox is not multi-collumn. So you either have a custom control or you have a DataGridView and the answer would greatly differ based on each type of control.
United States
|
|
|
|
|
He probably means a ListView. If that's the case, he's SOL.
:josh:
My WPF Blog[^]
|
|
|
|
|
ListBox can be multicolumn (ListBox.MultiColumn = true) but these columns are not the same as ListView columns (in Details mode) or Grid columns. Every item in a ListBox can contain only a single value and there is no column2 of the item1. To understand how it works just create a ListBox with size 300x300, fill it with 100 items and set MultiColumn = true. Then set MultiColumn = false. And you will see difference between ListBox columns and Grid columns.
The answer is:
1. You can not add control to the column2 of the item1 because there is no column2 for the item1 in ListBox control.
2. You can not even add control to the item1's column1 because ListBox control doesn't allow it.
So if you want to add custom controls to the some list don't use ListBox control.
|
|
|
|
|
hi all,
this query :
string query = "insert into KiralamaBilgisi(Kasa,DovizCinsi,GunlukKira,ToplamKira,KiraBaslangic,KiraBitis,KiraSuresi,COSaati,KaydiYapan) values(" + Convert.ToInt32(txtOdaNo.Text) + ",'" + txtDovizCin.Text + "'," + Convert.ToInt32(txtGunlukKBedel.Text) + "," + Convert.ToDouble(txtToplamKBedel.Text) + ",#" + Convert.ToDateTime(txtKiraBaslangic.Text).ToShortDateString() + "#,#" + Convert.ToDateTime(txtKiraBitis.Text).ToShortDateString() + "#," + Convert.ToInt32(txtKiraSuresi.Text) + ",'" + cmbCOSaati.Text + "','" + lblUserName.Text + "')";
doesnt return any error if my regional and language options is English...
but it returns: Number of query values and destination fields are not the same
whats wrong with date values? what should i do so as to make my program work both for english and turkish computers ???
thanks in advance, bye.
|
|
|
|
|
Mehmet Fatih Akbulut wrote: values(" + Convert.ToInt32(txtOdaNo.Text) + ",
This parameter in values will be treated as a single string. If you actually debugged your code and looked at your query variable you would answer your own question in 2 seconds.
You probably want :
values("'" + Convert.ToInt32(txtOdaNo.Text) + "'", ...
|
|
|
|
|
Hi
I want to know how to change the skin of a Windows Form. How can I change replace the MaximizeBox of a Windows Form as example. I don't want to use third party components. I just want to write my own stuff. But yet, i don't know how. Can anyone shortly explain how to make my own Windows Form or to replace the header with a grphic..
Thx
|
|
|
|
|
Try to see this example:
http://www.codeproject.com/cs/miscctrl/GoogleTalkWindowsForm.asp
|
|
|
|
|
|
Hy,
To create a skin for a windows form i use images. Set an images as the background image of your form and also set the border style of the form to None. The image I use has already drawn on it a maximize box and other buttons. I only put a label on top of these buttons and handle the click event. Using this method you can place buttons everywhere on the form.
Hope my suggestion helps
Do your best to be the best
|
|
|
|
|
Hi!
I have a ListView with two date-columns, "started", and "ended". I want them all to be sorted on the "started" column, but I want all the rows without an "ended" value separated and displayed before rows with "ended" value, like this:
Started Ended
050101
051110
051231
050101 061231
050910 061231
Ive done an ListViewItemSorter thingie, but I can't seem to make it sort with two separate columns:
class ListViewSortering : IComparer <br />
{<br />
private int col;<br />
public ListViewSortering() <br />
{<br />
col=0;<br />
}<br />
public ListViewSortering(int column) <br />
{<br />
col=column;<br />
}<br />
public int Compare(object x, object y) <br />
{<br />
return -String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);<br />
}<br />
}
And the call:
this.wmLvInsatser.Sorting = SortOrder.None;<br />
this.wmLvInsatser.ListViewItemSorter = new ListViewSortering(1);<br />
<br />
this.wmLvInsatser.Sort();
Can anyone point me in the right direction?
-- modified at 7:27 Monday 10th July, 2006
|
|
|
|
|
Hi,
the following modification should work:
class ListViewSortering : IComparer
{
private int colStart;
private int colEnd;
public ListViewSortering()
{
colStart=0;
colEnd=0;
}
public ListViewSortering(int columnStart, int columnEnd)
{
colStart=columnStart;
colEnd=columnEnd;
}
public int Compare(object x, object y)
{
ListViewItem lvi1 = (ListViewItem)x;
ListViewItem lvi2 = (ListViewItem)y;
string start1 = lvi1.SubItems[colStart].Text;
string end1 = lvi1.SubItems[colEnd].Text;
string start2 = lvi2.SubItems[colStart].Text;
string end2 = lvi2.SubItems[colEnd].Text;
if (end1.Length == 0 && end2.Length > 0)
return -1;
if (end1.Length > 0 && end.Length == 0)
return 1;
return -String.Compare(start1, start2);
}
}
So basically when only one of both items doesn't have an end date you'll return a special result value. In all other cases the normal comparison is done.
Robert
|
|
|
|
|
I'll try that out, thanks alot!
-- modified at 9:56 Monday 10th July, 2006
Worked like a charm
|
|
|
|
|
Where can I find Articles on transforming .Doc file to a single string so i can keep it in the DB
thank you
what's hard we do what's impossible will just take longer time to complete
|
|
|
|
|
Probably this is the one you are looking for:
http://www.codeproject.com/csharp/convertdocintootherformat.asp
|
|
|
|
|
Depending on your intended usage of the data it would be more effecient to store the document in a binary field.
|
|
|
|
|
I want to run queries on the string and find specific words
may be you have another idea?
thanks
what's hard we do what's impossible will just take longer time to complete
|
|
|
|
|
Hi,
I convert an C# application created in VS 2003 to VS 2005, and
notice that the button is still of the old appearance style in VS2003, and even I add new button in the form converted from VS2003,
the button style still the same ? Why, and how can I change it
to the new appearance of VS 2005 ?
Thanks
|
|
|
|
|
Hm... I know that there is a new context menu, but I don't think that there is anything new with the buttons?
---
b { font-weight: normal; }
|
|
|
|
|
I've been building new VS2005 WinClients for quite awhile now and there is not difference in the Button class.
|
|
|
|
|
Don't you notice that the button class in VS2003 is more ugly
that the VS2005, for both using the same "standard" FlatStyle property ?
|
|
|
|
|
|
Would you mind leave ur email to me so I can send
the pics of the button to you for illustration ?
Do you think there are any window theme settings
for the form that can affect the button appearance ?
|
|
|
|
|
Did you try "system" instead of "standard" for the FlatStyle?
|
|
|
|
|
Hi everybody,
I would be glad if anyone can help to get printer information using C#.
Details like how many printers are connected,their configuration ,etc to a PC(connected in a LAN).
Thanks & Regards,
Karthik.
|
|
|
|