|
sodevrom wrote: I know this is possible because I seen it in action somewhere
Yup, it's possible
sodevrom wrote: I do not want to use owner draw, because I would have to implement tons of things
You want non-standard behavior, and that has to be implemented somewhere. Owner-drawing might sound like overkill, especially if you've been looking at examples that draw a lot manually. The example on MSDN[^] looks rather short and might do the trick.
sodevrom wrote: and I still want the list to look exactly like in windows
Make sure you're using the SystemColors[^] when drawing.
I are Troll
|
|
|
|
|
I'm not sure I understand your question fully, but I think you can set the Enabled Property to true and the Readonly property to true also.
Apologies in advance if I have misunderstood your question.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hi,
I don't think you understand exactly what I want. I simply want to view the selection in blue always (with multiple items), even if the listview has no focus. In a normal case, when the listivew loses focus, the selection turns gray, and you can't see it good.
|
|
|
|
|
Create your own list view and your own list view items. This is the easiest way to get the results you desire. In fact, it would have taken less than 4 hours, I bet.
|
|
|
|
|
Hello,
Thanks for the suggestion, I was trying to avoid this...
|
|
|
|
|
This is a very basic solution, but here it is anyway:
private List<int> selections = new List<int>();
private bool dontChange = false;
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (!dontChange)
{
dontChange = !dontChange;
int selectedIndex = listView2.SelectedIndices[0];
listView1.SelectedIndices.Clear();
if (selections.Contains(selectedIndex))
{
selections.Remove(selectedIndex);
listView1.Items[selectedIndex].BackColor = Color.White;
}
else
{
selections.Add(selectedIndex);
listView1.Items[selectedIndex].BackColor = Color.Blue;
}
}
else
{
dontChange = !dontChange;
}
}
of course this only works if you're selecting one item at a time. If you're doing an extended selection (meaning using Ctrl or Shift to select items) it wouldn't work because when you click the first time, it will add the item, then when you click the second time, it tries to make all of the items selected, which would deselect the first item. You'd have to include some key checking to see if Ctrl or Shift was down.
|
|
|
|
|
Hello,
I tried something like you said, before posting on this forum, but I don't think it's going to work.
Now the problem is when selecting multiple items (by dragging). It can work only with 1 item, but if you have multiple items, and remove one item at a time from the SelectedIndices, it will call the event again and again. Don't know exactly how to explain.
Thanks anyways
|
|
|
|
|
Just a quick thought. The easiest way for this to work would be to "overwrite" the SystemColors . If it's possible to change the unfocused selection color form gray to blue, all my issues would have been solved...
|
|
|
|
|
You could write your own control?
Create a user control and add a panel with with background and add labels one below the other, you can provide a property that allows to set the background of the labels. Add some internal logic to maintain selection, colors, text, indexes, etc...
Should be less then 4 hours to get you going.
V.
|
|
|
|
|
A form with a LinkLabel control and set the form's KeyPreview to true.
when press [Enter], the linkLabel's linkLabel1_LinkClicked event is called, but the form's Form1_KeyDown event is not called.
I debug the program, but I can not find why the form cannot get the [Enter]'s keydown event, can any one help me? Or, there is a good tools to see the form event called one by one?
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication3 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
int i = 0;
}
private void Form1_KeyDown(object sender, KeyEventArgs e) {
int j = 0;
}
private void Form1_KeyPress(object sender, KeyPressEventArgs e) {
int i = 0;
}
private void linkLabel1_Click(object sender, EventArgs e) {
int i = 0;
}
}
}
|
|
|
|
|
Hi , Don't use "linkLabel1_LinkClicked"
Use this "linkLabel1_MouseClick"
private void linkLabel1_MouseClick(object sender, MouseEventArgs e)
{
}
AND : Optional , not necessary :
Avoid using KeyDown, KeyPress , KeyPreview
Just past this in your form body code
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Enter:
{
MessageBox.Show("You KeyDowned Enter Key!");
}
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
I know nothing , I know nothing ...
|
|
|
|
|
hi
i need to get data from .csv file to access
it works excellent but i have one problem.
when i try to get : IS-43"39"36"24
i receive: "IS-43""39""36""24"
some code:
while (SW.Peek() != -1)
{
TEMP = (SW.ReadLine());
TEMP = TEMP.Replace("'", " ");
char[] BI = { ',' };
string[] WI = TEMP.Split(BI);
A = WI[0].Trim().ToString();
B = WI[1].Trim().ToString().Replace (";"," ");
C = WI[2].Trim().ToString();
SQL = "INSERT INTO Items(barcode,des,numh) VALUES('" + A + "','" + B + "','" + C + "')";
Cmd = new OleDbCommand(SQL, Conn);
Cmd.ExecuteNonQuery();
Cmd.Dispose();
}
what can be the problem ?
thank's in advance
|
|
|
|
|
string sqlStatement = "INSERT INTO items (barcode, des, numh) VALUES (@a, @b, @c);";
...
command.Paramaters.Add("@a", SqlDataTypegoesHere).Value = wi[0];
command.Paramaters.Add("@b", SqlDataTypegoesHere).Value = wi[1];
command.Paramaters.Add("@c", SqlDataTypegoesHere).Value = wi[2];
...
command.Execute();
Btw, clean up your code. It's a mess.
|
|
|
|
|
Hi
I`m running a simple application that acts as a portal for users to go to various sites such as Gmail and Facebook. I have a SQL database running in the background where I store all user passwords etc. At the moment, users access this application from 2 computers, meaning there are 2 databases. Thus, if a user updates his/her details on the one computer, it does not get reflected in the other database. Is there a way I can share a single SQL database between these 2 client computers? They are connected over a network.
|
|
|
|
|
Etienne_123 wrote: Is there a way
Yes, it's called SQL Server after all.
However, I don't think storing passwords is a good idea.
|
|
|
|
|
Thanks. Just wanted to know before I started searching all over. I`m encrypting the passwords before storing them in the database though. Plus, its a prototype application run at an old age home, so security isn't my main priority, user-friendliness is.
|
|
|
|
|
If you are in the United States and "old folks home" qualifies as Health Care which means the data you are accessing, storing, and retrieving falls under HIPPA which is security intensive.
|
|
|
|
|
Ahem; HIPAA. But it only applies to health-related data; I don't think it applies to email passwords.
|
|
|
|
|
Ahem: he is writing software for an "old people's home", copying and pasting SQL Server database's and relying on storing email passwords in a database. Does any part of this not set off data security alarms? My post was a polite reminder that there are legal repercussions for such a cavalier attitude towards data security.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: set off data security alarms
Absolutely, as I mentioned in my first post, but I don't think HIPAA is involved. I had a class on HIPAA last month. It's more a common sense issue -- don't write down passwords... anywhere. Especially where others can get them.
And don't trust a third party to keep them safe.
|
|
|
|
|
I am now working with an ERP application, but the database is getting bigger and bigger, my application have database with 300MB size after 6 months only!!! and the application is getting slower because huge amount of data, especially when user ask for a report or do some inquiries in screens, I am thinking about partial loading solution to load the data partially when user scroll the data, but I have problems with sorting and hanging when user scroll data, what is the best solution for my application,
The environment is
VB.NET 2008
3 tiers architecture
SQL SERVER 2008
Possibly using VPN connection (makes application give time out)
Any help is highly appreciated
|
|
|
|
|
300mb is not very big. Is the database well designed/properly normalized? Are all of the required indexes and relations in place? Have all of the stored procedures been optimized? There is more but start there and see how you go. There are plenty of Sql helper websites out there: here's one: SQLServerCentral.com[^]
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
You have asked this question in multiple forums, please don't. BTW - there is no C# component to your application there, so I don't know why you'd even think of choosing this forum.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Rethink your design.
Mdallal84 wrote: when user scroll the data
Users shouldn't be scrolling data at all.
Mdallal84 wrote: partial loading
Like paging?
Why do I get the feeling you have one big DataGrid/View ?
|
|
|
|
|
You were right , A big datagridview !
I was about to say the same
I know nothing , I know nothing ...
|
|
|
|