|
??? I don't understand your code and what do you want to do with that, but normally I use it like this:
OpenFileDialog openFileDialog = new OpenFileDialog();
DialogResult dialogResult = openFileDialog.ShowDialog();
if(dialogResult == DialogResult.OK && openFileDialog.FileName != "")
{
} or
OpenFileDialog openFileDialog = new OpenFileDialog();
if(openFileDialog.ShowDialog() == DialogResult.OK)
{
System.IO.FileStream filestream = openFileDialog.OpenFile();
filestream.Close();
}
Before ShowDialog() you can only set the property like Path, Filter, etc...
Then you must call ShowDialog() to show the dialog. If the user select a file and click OK, then
you get a return value DialogResult.OK. Then you can get the filename by calling openFileDialog.FileName.
|
|
|
|
|
I am generating an Excel workbook from within a C# console app and wish to duplicate a worksheet which includes a pivottable. This however does not create a new pivotcache, so when the original worksheet is updated, the second is as well.
Does anyone know how I can separate the caches after they have been created? It is easy to link the new pivottable's pivotcache to a third pivotcache, but creating a new pivotcache without actually setting up a new pivottable seems impossible.
Thanks.
|
|
|
|
|
how can i read data about product from barcode and stoe it in data base
i hope an example becuase i am not profisional
then you for help
MD_NADA
|
|
|
|
|
Search CodeProject on the keyword "barcode" and you'll find articles that show how to work with barcodes.
:josh:
My WPF Blog[^]
|
|
|
|
|
How to add Application.config file for windows application project and how to access data from the file
Jey
|
|
|
|
|
Just select Add/New item (or something semantically equivalent - I don't have an english VS at hand) in your project and select Application configuration file. You'll get a file named "App.config" which is renamed to <YourExecutableName>.exe.config and copied to your output directory.
To access entries in the file you should take a look at the System.Configuration namespace.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I'm trying to display my desktop icon's in a listview with a transparant background. I want the icons to be perfectly visible and the white background color to blend in with the graphics below the form.
So actually setting ListView.BackColor to transparant would do the trick. But ListView.BackColor doesn't support transparancy.
Is there an other 'listview' component that does support transparancy, or any other way to achieve a transparant background below the icons?
Cheers, Richard
|
|
|
|
|
You'll have to set a certain color as the BackColor of your ListView (I usually take magenta or cyan for this purpose) and then set the TransparencyKey of the Form containing your ListView to the same color.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Okay great, that worked. But now it's like there's no background at all.
Is there a way to make it semi transparant?
I tried to make a custom color with a alpha value of say 20, but then the listview complains again about not supporting transparant colors...
|
|
|
|
|
To achieve semi-transparency, you'll have to dig deeper into layered windows. But beware, that's not a trivial task and only has very limited support within .NET. YOu'll have to use lots of p/invoke calls to get layered windows working right.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi
I am using following code to Import data from Excel File in .NET 2005
DataSet myDataSet = new DataSet();
string strConn = @"Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\test.xls;Jet OLEDB:Engine Type=5; Extended Properties=Excel 9.0";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter addapter = new OleDbDataAdapter();
addapter.SelectCommand = new OleDbCommand("Select * From Mercury$", conn);
addapter.Fill(myDataSet);
On Executing it is giving me Following error
"Could not find installable ISAM."
I am using Excel2003 installed on Windows 2000.
Thanks in advance
Abhi
|
|
|
|
|
Try this
Extended Property="""Excel 9.0"""".
i guess that works for u.
Regards,
Pramod
|
|
|
|
|
|
Hi,
How can i count the total number of rows and columns in the List View, is there any properties or methods with out using loops.
|
|
|
|
|
Hi,
there are some properties that can be used to obtain the number of columns and rows:
Columns:
MyListView.Columns.Count
Rows:
MyListView.Items.Count
Regards
Sebastian
|
|
|
|
|
Ofcourse i want to get the currently selected row and column is it possible if so how to do it?
-- modified at 9:07 Tuesday 4th July, 2006
|
|
|
|
|
listView.SelectedItem
You do have IntelliSense don't you?
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
i'm trying to implement control array in my app. the no of control will depend on user's requirement. total number will be gathered from database. therefore i had to make the code within a method.
<br />
private void CreatePictureBoxes()<br />
{<br />
....<br />
....<br />
PictureBox[] pcbMem = new PictureBox[intCount];<br />
Label[] lblMem = new Label[intCount];<br />
....<br />
}<br />
since i'm doing the whole code in a method i can't access those controls outside of that method. it's also not possible for me to create them in class level as the total index is unkown to me initially. i don't know how to reasign the length of an array so it's being a problem for me.
so please help me out to creating the controls so that i can use them from anywhere.
|
|
|
|
|
vatzcar wrote: it's also not possible for me to create them in class level as the total index is unkown to me initially
Just declare them at class level and instanciate them inside the method.
PictureBox[] pcbMem;
Label[] lblMem;
private void CreatePictureBoxes()
{
....
....
this.pcbMem = new PictureBox[intCount];
this.lblMem = new Label[intCount];
....
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
vatzcar wrote: i don't know how to reasign the length of an array so it's being a problem for me.
To solve this problem, you could use a generic list.
using System.Collections.Generic;
List<picturebox> pcbMem = new List<picturebox>();
Private void CreatePictureBoxes()
{
...
for (int i = 0; i < intCount; i++)
{
PictureBox myPcb = new PictureBox();
...
pcbMem.Add(myPcb);
}
}
|
|
|
|
|
Hi All,
Can somebody help me how to disable the addressbar and the menus, for a web application???
Rach
|
|
|
|
|
Hi,
use window.open method. assign features property in this method.
example,
window.open(sURL, "HELP", "resizable=yes,titlebar=no,toolbar=no,location=no,status=no,menubar=no");
|
|
|
|
|
You'll need a piece of JavaScript code, so you should ask in the web development forum.
_____________________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA] - Developing ScrewTurn Wiki 1.0b...
|
|
|
|
|
Kiindly help and reply soon.
pooja
|
|
|
|
|
erm, sender is not of type "MenuItem" - its pretty straight forward as far as error messages go!
Do you by any chance define a class in your project with the name "MenuItem"
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|