|
i had a quick fiddle with developer express and i like infragistics better
also like my idea for quick and easy card layout, no overhead and its fast.
this post is getting interesting though
regs,
g00fy
|
|
|
|
|
I have a PagePanel class that I use for this kind of thing. I use it with MyXaml mainly but you can download it here[^].
If I get sometime tonight, I'll build a non-MyXaml sample.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I am having problem in saving and closing excel files in excel automation.can u anyone help me on that
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace mlist_intializer_tool
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private Excel.Application ExcelObj = null;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
ExcelObj = new Excel.Application();
// See if the Excel Application Object was successfully constructed
if (ExcelObj == null)
{
MessageBox.Show("ERROR: EXCEL couldn't be started!");
System.Windows.Forms.Application.Exit();
}
// Make the Application Visible
ExcelObj.Visible = true;
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
string[] ConvertToStringArray(System.Array values)
{
// create a new string array
string[] theArray = new string[values.Length];
// loop through the 2-D System.Array and populate the 1-D String Array
for (int i = 1; i <= values.Length; i++)
{
if (values.GetValue(1, i) == null)
theArray[i-1] = "";
else
theArray[i-1] = (string)values.GetValue(1, i).ToString();
}
return theArray;
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(80, 80);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(136, 64);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open(
"F:\\HAI.XLS", 0, true, 5,
"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
0, true);
// get the collection of sheets in the workbook
Excel.Sheets sheets = theWorkbook.Worksheets;
// get the first and only worksheet from the collection
// of worksheets
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(2);
// loop through 10 rows of the spreadsheet and place each row in the list view
for (int i = 1; i <= 100; i++)
{
Excel.Range range = worksheet.get_Range("A"+i.ToString(), "S" + i.ToString());
System.Array myvalues = (System.Array)range.Cells.Value;
range.Cells.Value="value";
string[] strArray = ConvertToStringArray(myvalues);
for (int k = 1; k < strArray.Length; k++)
{
char chr='A';
int ch=chr;
ch+=k;
chr=(char)ch;
string str=new string(chr,1);
//axSpreadsheet1.ActiveSheet.get_Range(str+i.ToString(),str+ i.ToString()).Value=strArray[k];
//axSpreadsheet1.ActiveSheet.get_Range("B"+i.ToString(),"B"+ i.ToString()).Value=strArray[1];
}
//}
theWorkbook.Save();
}
theWorkbook.Close(0,0,0);
ExcelObj.Quit();
}
}
}
Life Is A journey,But destination is what we make out of it
-- modified at 0:03 Monday 7th November, 2005
|
|
|
|
|
I'd like to create my own c# browser to display my own pages with some links.
Then I want my browser to popup my C# Window form when I click a link.
Please help me how can I like this.
|
|
|
|
|
This[^] article describes how to embed the web browser into your C# application.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you very much. But my main problem is not how to create browser, it's how can I pop my windows form up when a link is clicked.
|
|
|
|
|
Hi,
Can someone please tell me how can I zoom in and out of an image that is displayed in a picture box control???
Please Help...
Thanks,
E.A.
|
|
|
|
|
You can't. So many people seem to think a picture box control should be a full featured image viewer, and it's not. It's for showing a picture. If you want to do anything more, you'll have to write the code yourself. I prefer to put a panel on my form and use it to work out the bounds to draw my own images for this very reason, it means I have full control. The Graphics.DrawImage method has a number of overloads, and all are designed to be able to zoom into an area of an image and/or draw only part of the image.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yup, ehat Christian said. Or you can use the search function of Codeproject : PictureBox with zooming and scrolling[^].
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Inconsistent accessibility: parameter type 'HDRImaging.HDRImage' is less accessible than method 'HDRImaging.ImagePyramid.ImagePyramid(HDRImaging.HDRImage)'
What does this mean ? The error is here :
public class ImagePyramid
{
private HDRImage source;
public ImagePyramid(HDRImage bitmap) <----- error !!!
{
source = bitmap;
}
in the constructor. The HDRImage class is in the namespace and has several public constructors.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Don't worry, I found it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am writing a C# app and I want to store the bits of a bitmap in an array. So I have declared an array to hold the right number of bytes, and I have a byte *, but is there any way to copy the data into the array in one go, instead of one item at a time ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Marshall.Copy seems to do the trick
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There doesn't seem to be a SelectedIndex property for a listview control. As I did with a listbox's SelectedIndex I need to be able to get the int index value of whichever item is selected in the listview. I have set the listview's multiple selection to false as I only want one item selected.
How can i find out what the index is of the selected item??
Could someone please show me in code??
|
|
|
|
|
Look again, there _is_ a SelectedIndices and a SelectedItems property.
mav
|
|
|
|
|
Yes but these are read only. SelectedIndices returns a collection not an index number and SelectedItems also returns a collection. I need just the selected items index number.
|
|
|
|
|
Ermm SelectIndices return a collection of Items Index Number that has been selected, isnt that what you wanted? I thought Mav.Northwind hit the mark.
|
|
|
|
|
if (this.listView1.SelectedIndices.Count > 0)
{
/*
* This will simply return the first index.
* If you set the MultiSelect property to false,
* that's all you need. Otherwise, just iterate
* through the array with a for
*/
int i = this.listView1.SelectedIndices[0];
}
This should do the trick.
Hope it helps,
azazel
|
|
|
|
|
Hey guys,
I'm using the following code to connect to my remote mysql database. Of
course I changed the server, database name, login/pass info, for my
posting on the web...
string connectString="DRIVER={MySQL ODBC 3.51 Driver};SERVER=xxx.xxx.xxx.xx;PORT=3306;DATABASE=dbName;UID=userName;PASSWORD=xxxxxxxxx;OPTION=3";
OdbcConnection connection = new OdbcConnection(connectString);
try
{
OdbcConnection connection = new
OdbcConnection(connectString);
}
catch (System.Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
Console.WriteLine("ERROR");
}
When I run the program it does NOT go in the catch statement (but goes into the finally). Using a debugger I can see that my connection state is closed the entire time. I installed the ODBC driver and added my database connection (which it succesfully connects to) to the "Data Sources (ODBC)" component of the administrative tools. I named this connection "CSDatabaseServer". So I also tried setting my connectString="DSN=CSDatabaseServer". That did not work either however.
Any help would be appreciated, thanks guys.
|
|
|
|
|
telconstar99 wrote: my connection state is closed the entire time
That's because you never call connection.Open() .
Have you tried that:
<br />
OdbcConnection connection = new OdbcConnection(connectString); <br />
try<br />
{<br />
connection.Open();<br />
}<br />
catch (System.Exception e)<br />
{<br />
Console.WriteLine(e.Message);<br />
Console.WriteLine("ERROR");<br />
}<br />
finally<br />
{<br />
Console.WriteLine("FINISHED, with errors or not.");<br />
connection.Close();<br />
} <br />
Note that the finally block is always reached. It's for lines that must be executed in any case, no matter if exceptions occurred ot not.
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
Thanks for the help man. That's all it needed. The tutorial I was going through didn't do that...which seems very strange. Now that I'm looking for it I noticed other tutorials did that step. Thanks!
|
|
|
|
|
Your tutorial is for .NET 1.0, Open() was new in .NET 1.1.
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
hi i want to create iso image, but i don't know how can i ..
please help me ...
hdv212@yahoo.com
|
|
|
|
|
my first guess would be to find the file format for iso specification, i imagine it is readily available.
i have never done this but when i was tinkering with zip creation i needed to know the file spec before i could create one
maybe this[^] can get you started
hope that helps
g00fy
|
|
|
|
|
The format is available, but sometimes it can be a bit fuzzy what they mean. I glanced at an open source implementation (can't remember the name, it was a command line thingy normally available on for example Linux). This was for an internal use only project, so GPL code was not a problem but you should be careful if you need to release the program.
It is relatively easy task, but I would still estimate a week to do it (and I have done it before).
|
|
|
|