|
I want to display a list view that will contain data as follows:
Column 1 will display normal text data, column 2 will contain multiple images and every image will have a click event.
How can I do this?
|
|
|
|
|
Use a datagridview - I'm pretty sure you cannot add multiple controls (picturebox) to a cell though. Feels like a custom control requirement to me.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi guys!
Does anyone know of a replacement for the FlowLayoutPanel control that supports VirtualMode and selection of items? I guess I could make one myself, but I was hoping someone already did this before. What I am really looking for is a control that has the functionality of a ListView but supports templating controls like FlowLayoutPanel.
Thanks
|
|
|
|
|
hi
i developed a project in c# and the final ouput is generated in crystal reports and created a setup of project and installed in client system and i separately installed crystalreport setup which i downloaded from net.
now my problem is...
my client is to install two setups in each system
1)project setup
2)crystalreport setup
can we combine these two setups and make a new setup which installs my project and crystalreport exe
|
|
|
|
|
Did you try adding the Crystal Reports merge module to your deployment project?
Or you could check the prerequisites box for CR if you prefer.
|
|
|
|
|
hey i am working in .net application in c#.........i need to delete differnt items from list view with the help of timer on the selectedindexchange event.....the problem is that when i select one item at a time within the elapsing time of the timer there is no problem, but when i select multiple items at a time within the elapsing time of the timer the timer is set only on the last selected item and it gets removed from the previous one............is there any way to set timer on every selected item of the listview.......i need the code in c#......kindly help....
this is what i am doin........
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace timer
{
public partial class Form2 : Form
{
System.Windows.Forms.Timer m_Timer;
public Form2()
{
InitializeComponent();
listView1.SmallImageList = AlertImageList;
m_Timer = new Timer();
m_Timer.Interval = 5000;
m_Timer.Tick += new EventHandler(m_Timer_Tick);
}
void m_Timer_Tick(object sender, EventArgs e)
{
listView1.Items.RemoveAt(y);
}
public int y;
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (listView1.Items.Count > 0)
{
y = listView1.SelectedItems[0].Index;
//m_Timer.Stop();
m_Timer.Start();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public int i = 0;
private void btnClick_Click(object sender, EventArgs e)
{
ListViewItem item = new ListViewItem(i.ToString());
listView1.Items.Insert(0, item);
i++;
}
}
}
modified on Thursday, June 4, 2009 6:32 AM
|
|
|
|
|
snehanp wrote: ..i need the code in c#......immediate help will be appreciated.......
Wow - that's about the worst thing you can do.
1 - you don't show us any code
2 - you ask us to provide a full solution
3 - you tell us you need it quickly
We don't work for you. We help you for free. We do this despite the fact that increasingly, the people asking here are clueless to the point of not even being able to understand good answers.
If you want each item to have it's own timer, then you need to create a timer for each item. It sounds like you're only creating the one.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
snehanp wrote: immediate help will be appreciated
If I choose to provide any help, I will do it at my spare time and I don't really care if you appreciate me for that.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
snehanp wrote: immediate help will be appreciated.......
It may be appreciated, but it's not going to be forthcoming in the way you want.
snehanp wrote: i need the code in c#......
Well, that's the name of this forum so at least you got that right. Unfortunately for you though, you aren't my boss so I'm proceeding to urgently not writing the code for you.
Yes - you can set timers on every selected item, and you'd then handle the timer events for each one. It sounds like you want to create a list of timers and deal with them like that.
"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
|
|
|
|
|
thanks Pete if possible can u kindly help with the code whenever possible at ur pace.......i hav posted the code i hav done.....what i am doin is that i am first manually adding numbers to the listview and then on select index change i hav set the timer....
|
|
|
|
|
I knocked this quick sample together, and it should do what you want:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SimpleWinApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
_list.Add("Hello");
_list.Add("There");
_list.Add("What do you think");
int i = 0;
foreach(string item in _list)
{
listView1.Items.Add(new ListViewItem(string.Format("{0}. {1}", i++, item)));
}
}
private List<string> _list = new List<string>();
private List<Timer> _timers = new List<Timer>();
private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
Timer timer = new Timer();
timer.Interval = 1000;
timer.Tag = e.Item;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
_timers.Add(timer);
}
void timer_Tick(object sender, EventArgs e)
{
Timer timer = sender as Timer;
if (timer != null)
{
timer.Stop();
timer.Tick -= new EventHandler(timer_Tick);
ListViewItem item = timer.Tag as ListViewItem;
item.Remove();
_timers.Remove(timer);
}
}
}
}
"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
|
|
|
|
|
hey pete thanks a ton.......it solved my problem......
modified on Friday, June 5, 2009 2:22 AM
|
|
|
|
|
You're welcome.
"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
|
|
|
|
|
Hi friends
for example here Main form(this is not maximized form) in which if i click button it will open new maximized form, after i doing the job i will close it.
problem is that after closing child form the parent MDI form is becoming maximized automatically.
can any one help to fix this problem
thanks
|
|
|
|
|
Thats by default. Do one thing, dont maximize the child form so as to prevent the parent MDI from maximizing.
|
|
|
|
|
child form has to be maximized, is there any other tech to handle ?
|
|
|
|
|
Uhm forgive me if I'm wrong, I have not worked with MDI for 15 years, but isn't an MDI main form a container for child forms and as such has to "contain" the child. Is it possible to drag a child form outside an MDI container these days. If this is the case then your question is a really dumb one.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I want build a BHO which controls internet Explorer(IE6 or IE7) on client side. Intially, How can I get the .Net control of an HTML page?
|
|
|
|
|
Read the Microsoft documentation.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, In my database table i have column with data like
00987
78960
89760
08123
009876
when i read the value(00987) into the integer variable, then it contiana value as 987.
I need the value in integer variable as same(00987). How can i do this?
int k = Convert.ToInt16(dt.rows[i]["colname]);
G. Satish
|
|
|
|
|
00987 is the same as 987. If you read it into an integer variable, then it will remove leading zeros. If you want to display it as it is in the database, then convert it to a string instead of an integer
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Do you know how to count ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
This data is stored as a string in your database. 00987 is exactly the same as 987 - I assume you want it displaying as 00987; in which case you need to use a string to display it.
"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
|
|
|
|
|
Satish - Developer wrote: when i read the value(00987) into the integer variable, then it contiana value as 987.
I need the value in integer variable as same(00987)
You have to do nothing (or just review your basic math course material), since 000987 = 987 holds for a integer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I suppose that what you really wanted to ask is: how to read a data with leading zeros and don't loose these zeros.
You have two possibilities:
- Store the number asa string in your application and parse it each time you need it for calculations.
- Create a structure which would store a number of zeros (I would do it this way).
internal struct IntWithZeros
{
private int zerosCount, value;
public static implicit operator int(IntWithZeros x)
{
return x.value;
}
public static IntWithZeros Parse(string data)
{
IntWithZeros ret;
ret.zerosCount = 0;
while (data.Length > ret.zerosCount && data[ret.zerosCount] == '0') {
ret.zerosCount++;
}
ret.value = int.Parse(data);
return ret;
}
public override string ToString()
{
string s = value.ToString();
return s.PadLeft(s.Length + zerosCount, '0');
}
}
Greetings - Jacek Gajek
|
|
|
|