|
You're not seeing the items because you haven't added any columns to your list view.
private void Form1_Load(object sender, EventArgs e)
{
ListView MaLV = new ListView();
MaLV.Parent = this;
MaLV.Dock = DockStyle.Fill;
MaLV.View = View.Details;
ColumnHeader ch = new ColumnHeader();
ch.Text = "Column Name";
MaLV.Columns.Add (ch);
MaLV.Items.Add(new ListViewItem("Travaux"));
MaLV.Items.Add(new ListViewItem("Stocks"));
MaLV.Items.Add(new ListViewItem("Energie"));
MaLV.Items.Add(new ListViewItem("Synchronisation"));
MaLV.Items.Add(new ListViewItem("Informations"));
MaLV.Items.Add(new ListViewItem("Quitter"));
this.Controls.Add (MaLV);
}
/ravi
|
|
|
|
|
Hi,
i tried what u wrote to me but still not showing anything.I read in some tuto to set the View property of my ListView to LargeIcon and then set the LargeImageList property with my required images.I don't understand this.can u explain to me?
thanks
|
|
|
|
|
The code I posted works for me. I haven't set the image index because the list view mode is "detail". You'll need to post your code if you'd like me to take a look at it.
/ravi
|
|
|
|
|
Hi Ravi,
I want to ask u before that in ImageList'proprieties i give as image size 64,64 but in reality my images(icons) haven't this size.Is that a problem.
For my code,my project contain 1 Form which has this code
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Essaie
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ListView MaLV = new ListView();
MaLV.Parent = this;
MaLV.Dock = DockStyle.Fill;
MaLV.View = View.Details;
ColumnHeader ch = new ColumnHeader();
ch.Text = "Column Name";
MaLV.Columns.Add(ch);
MaLV.Items.Add(new ListViewItem("Travaux"));
MaLV.Items.Add(new ListViewItem("Stocks"));
MaLV.Items.Add(new ListViewItem("Energie"));
MaLV.Items.Add(new ListViewItem("Synchronisation"));
MaLV.Items.Add(new ListViewItem("Informations"));
MaLV.Items.Add(new ListViewItem("Quitter"));
this.Controls.Add(MaLV);
}
}
}
Thanks a lot for u contribution
Marwen
|
|
|
|
|
Just a reminder to put your code in the code block tags. It makes it much easier for others to read and review.
|
|
|
|
|
Hi,
I replace it.Yes so nice and more lisible.Can u give me now a solution
Thanks Leckey
|
|
|
|
|
Hi
i need wfmc table definitions to implement wf in my app according to wfmc standards, i found Business Process Analytics Format Schema in this[^] link, but could not found table definitions and database schemas.
can anybody help me ?
thanks.
|
|
|
|
|
Does this have anything to do with C#?
It's time for a new signature.
|
|
|
|
|
Does this have anything to do with programming?
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I created a UserControl that contains three RichTextBox controls. I added a PrintDocument property, and the methods required to print (Print, PrintPage, BeginPrint, etc).
I have a loop that iterates the data and loads three strings in the RichTextBox controls, one to each control, and then calls PrintDocument.Print(). It should then print that page and get the next three strings of data to print.
This works fine for the first page, but the other pages don't print. After calling PrintDocument.Print() the program returns to the main form that called the UserControl print method.
How do I continue iterating through my loop to print more pages?
|
|
|
|
|
Hi,
the general answer is: in the PrintPage handler, you should set PrintPageEventArgs.HasMorePages ; however it might be more complex than that when printing list-oriented controls (including RichTextBox) as there may be more data in them than is visible at any one time on your Form.
|
|
|
|
|
Luc Pattyn wrote: you should set PrintPageEventArgs.HasMorePages;
I already thought of that. I also thought of setting the printrange to currentpage and then repeatedly call Print. Even that failed.
pagesLeft = this.Print( e );
if ( pagesLeft < cardsToPrint.Count )
{
e.HasMorePages = true;
}
else
e.HasMorePages = false;
The Print() method calls Graphics.DrawString() and draws the strings on the PrintDocument graphics rect. For a single page it works perfectly.
|
|
|
|
|
This is what I suggest as a test: keep things as simple as possible. Hence use a boolean class member:
bool firstPage=true;
then do:
e.HasMorePages=firstPage;
firstPage=false;
That should print two pages, no matter what. Then take it from there.
|
|
|
|
|
I'll give it a try. Thanks!
|
|
|
|
|
Hello all,
Am developing mapwinGIS appln. I have inserted the vscrollbar control on moveing up and down nothing changes. Am suppose to give code for it. but i dont know how to go about it. Can someone help me out or give an idea of how to go about it??? or any sample code for it pls??
|
|
|
|
|
|
I'm new to sql and would appreciate some help on the best way to structure the following type of operation. I have a db containing stock symbols. I'm retrieving each symbol, calculating a series of moving averages and updating the symbol table with the calculated values for each row in the symbol table. The way I have things structured below takes "for ever" to run through? Utlimately there will be a 1000 or more symbols in the db. Any help would be appreciated!
try
{
SQLiteConnection conn = new SQLiteConnection(Constants.ConnectionString);
if (conn.State == ConnectionState.Closed)
conn.Open();
string CommandText = "SELECT symbol FROM master;";
SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(CommandText, conn);
DataTable dt = new DataTable();
dataAdapter.Fill(dt);
DataTable symdt = new DataTable();
IMovingAverage ma20 = new SimpleMovingAverage(20);
IMovingAverage ma50 = new SimpleMovingAverage(50);
IMovingAverage ma200 = new SimpleMovingAverage(200);
foreach (DataRow r in dt.Rows)
{
CommandText = "SELECT * FROM " + r["Symbol"].ToString() + ";";
SQLiteDataAdapter symdataAdapter = new SQLiteDataAdapter(CommandText, conn);
symdataAdapter.Fill(symdt);
int count = 0;
foreach (DataRow symr in symdt.Rows)
{
if (symdt.Rows.Count >= 20)
{
ma20.AddSample(Convert.ToSingle(symdt.Rows[count]["Close"]));
symdt.Rows[count]["MA20"] = ma20.Average;
}
if (symdt.Rows.Count >= 50)
{
ma50.AddSample(Convert.ToSingle(symdt.Rows[count]["Close"]));
symdt.Rows[count]["MA50"] = ma50.Average;
}
if (symdt.Rows.Count >= 200)
{
ma200.AddSample(Convert.ToSingle(symdt.Rows[count]["Close"]));
symdt.Rows[count]["MA200"] = ma200.Average;
}
++count;
}
SQLiteCommandBuilder mySqlCommandBuilder = new SQLiteCommandBuilder(symdataAdapter);
symdataAdapter.Update(symdt);
symdt.Clear();
symdataAdapter.Dispose();
ma20.ClearSamples();
ma200.ClearSamples();
ma50.ClearSamples();
}
dt.Clear();
dataAdapter.Dispose();
conn.Close();
conn.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
|
|
|
|
|
|
While this approach could I'm sure be made to work I want to keep the general structure of what I'm doing since I'll be calculating other indicators not supported in SQL.
|
|
|
|
|
boreland wrote: calculating other indicators not supported in SQL
Such as? You stated you are calculating running averages, that indicates numeric data
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Could someone please advise if a transactional approach would be more efficient and if some how to do this using a datatable?
|
|
|
|
|
Your calculation of moving averages looks suspect. It looks like you're just adding the value from the nTh row to your "moving average", rather than the average of n rows...
You would likely get better performance and less memory consumption if you used a DataReader instead of a DataAdabtor and DataTables, and did your updates atomically as needed on a different connection using ExecuteNonQuery with an update statement instead of relying on a batch update...
|
|
|
|
|
They both appear to do the same thing to me, what should each one be used for and what one has a less performance hit?
Thanks!
|
|
|
|
|
Reading the documentation and, if important to you, performing a little experiment should provide the answer. Did you look at the values returned?
|
|
|
|
|
I am developing an add-in for VS for latex. The very first functionality I wish to implement is a button "compile" (to pdf). Well I can do that, but what I want is
1. Do not show a console window
2. Redirect text output (with errors/warnings/mesasges) from pdftex . The next step will be to parse these results and show them in a separate window.
I use the following code:
Document doc = _applicationObject.ActiveDocument;
if (Path.GetExtension(doc.Name) == ".tex")
{
var p = new System.Diagnostics.Process();
var pinfo =new ProcessStartInfo
{
CreateNoWindow = true,
FileName = "pdflatex",
Arguments = string.Format("\"{0}\" -c-style-errors", doc.FullName),
WorkingDirectory = Path.GetDirectoryName(doc.FullName),
};
p.EnableRaisingEvents = true;
p.Exited += p_Exited;
p.StartInfo = pinfo;
p.Start();
}
I have observed the following issues:
1. Uncommenting RedirectStandardError = true causes that pdftex does not work (no output file is generated at all)
If RedirectStandardError = true is commented, then pdftex does it's job. But:
2. Despite CreateNoWindow = true console still shows up.
3. p_Exited is never called
As you see none of things I wanted to do actually works. It is quite depressing. Any ideas?
Thanks--
Greetings - Jacek
|
|
|
|