|
Dear all,
can any one help me to find out the given control is container control or not.
Warm regards,
S. Mohamed hasan.
Have a nice day.
|
|
|
|
|
Hello i would like to create an excel file from my application that could include chart or images, is there any free component, or any other way to do it without using excel.interop(i want to run it even in a pc without excel installed)
D.M
|
|
|
|
|
Here's what you do:- Create an Excel Workbook with the type of content you want on each page
- Save the Entire Workbook as an HTML Page
- Look at how everything gets save and reproduce it with your project
I've had to do this more than once. Works like a charm.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
ty for ur reply but my output its a litle complicated to outut such way, i pass multi sized lists etc
D.M
|
|
|
|
|
I am using visual Basic .NET 2005
I have the following tables with data
------------------------------------------------------
Courses
=======
Course_Code Title
=========== ==============================
3403 Discrete Mathematics
3456 Calculus
3409 Electronics
3510 Business Research Methods
-------------------------------------------------------
Student
========
Student_ID Name
========== ===============================
6316 ABC
6318 XYZ
6309 CDE
6314 FGH
-------------------------------------------------------
Student_Courses
===============
Student_ID Course_Code
========== ===============================
6316 3403
6316 3409
6316 3456
6309 3456
6309 3510
6318 3403
-------------------------------------------------------
First I want to show all the courses available in a CheckedListBox (Display only the title for the course)
Then I want all those courses in the CheckedListBox to be checked if a particular Student had opted for those courses (retrieved from Student_Courses table)
When saving the data in Student_Courses table I want to save the checked courses
But the problem is how do I bind the CheckedListBox with a data source and get the lookup value (Course_Code) from the CheckedListBox
CheckedListBox does not have any of the DataSource, DisplayMember and ValueMember property
Is there any way around?
Can any other control serve this purppose?
Thank You.
|
|
|
|
|
I created a strong typed CollectionBase collection.
When I bind it to a DataGrid, it displays all the public properties for the class. I only want to display specific class properties. I tried to use the following code and it does not work.
How do you control what fields are displayed in the DataGrid?
private void BindArrayListToGrid()
{
// create some data
dataGrid1.DataSource = myCollection;
DataGridTableStyle ts = new DataGridTableStyle();
ts.MappingName = "ArrayList";
DataGridTextBoxColumn cs = new DataGridTextBoxColumn();
cs.MappingName = "id"; // Public property name
cs.HeaderText = "User ID";
cs.Width = 80;
ts.GridColumnStyles.Add(cs);
cs = new DataGridTextBoxColumn();
cs.MappingName = "name";
cs.HeaderText = "User Name";
cs.Width = 80;
ts.GridColumnStyles.Add(cs);
// Add the custom tablestyle to the DataGrid
this.dataGrid1.TableStyles.Clear();
this.dataGrid1.TableStyles.Add(ts);
}
TC
|
|
|
|
|
I want to open e web from my C# aplication but i need to autentificate with a proxi
how can i do it
|
|
|
|
|
Assuming you're using WebClient and your proxy is using basic authentication, add the
Proxy-Authenticate[^] field to the Headers collection.
string base64 = Convert.ToBase64String(Encoding.ASCII.GetBytes("<username>:<password>"));
webClient.Headers.Add("Proxy-Authenticate", "Basic " + base64);
Or, you can use the NetworkCredential class to do it for you.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
before anyting thanks for your reply and have a happy new year
i was trying to understand what i was asking for and i couldnt understand a sh*t anyway
i either understang anthing of what you answer me
what i was trying to do was a web application that, using forms authentication authenticate users from a db and could even create new users
i wish you could tell me how can i do the first
thanks
|
|
|
|
|
Hi,
I am trying to create an application which receives data from the network (probably a ZIP file) and write the content of network stream to the a LOCAL File... i can receive data and i can echo it out the console as well... i can write a file... but when i open up the file ... it has no content... what am i doing wrong?
here is the code:
private void readFile(int filesize)
{
try
{
FileStream fout = new FileStream(this.m_backupFileName,FileMode.CreateNew,FileAccess.Write);
NetworkStream ns = new NetworkStream(clientSock);
long rby=0;
int totalRecv=0;
//loop until the full bytes have been read
while( rby < filesize )
{
byte[] buff = new byte[1024];
//read from network stream
int i = ns.Read(buff,0,buff.Length);
Console.WriteLine(Encoding.ASCII.GetString(buff));
fout.Write(buff,0,i);
totalRecv += i;
rby = rby+1;
}
//done with reading
fout.Close();
//clientSock number of bytes
Console.WriteLine("Sending Num of Bytes");
clientSock.Send(Encoding.ASCII.GetBytes("DONE " + totalRecv.ToString()));
//get server's response
byte[] buf = new byte[128];
string resp = "";
clientSock.Receive(buf);
resp = Encoding.ASCII.GetString(buf);
if( resp == "OK" )
Console.Write("File Transfer Complete");
else if( resp == "ERROR")
Console.Write("Please Try Again");
}
catch(Exception ex) { Console.WriteLine(ex.ToString());}
}
|
|
|
|
|
I am using a typed dataset to store my data. I use a dataView to pull out what i need. the problem comes up in one case. I have a dataView that does not return what it should.
The DV init is:
<br />
DataView mDv = new DataView(ds.tblData, "(issent = false AND userIDN = " + userID + ") OR pending_draws = true","dataID", DataViewRowState.CurrentRows);<br />
If i run the same parameters in a SQL query it returns the correct rows. any ideas?
|
|
|
|
|
I am using the File.Create method to create a text file. My problem is that when I need to write to that file after it has been created I get the error message "The process cannot access the file "C:\2005 Sim R4 MedAlu Data\TN.txt" because it is being used by another process.".
|
|
|
|
|
You must derive a FileStream von the Create method:
FileStream fs = File.Create("C:\2005 Sim R4 MedAlu Data\TN.txt");
After that you can access the FileStream:
fs.Write("Your Data");
and finally close it.
fs.Close();
-- modified at 9:49 Thursday 15th December, 2005
|
|
|
|
|
What code are you using? I suspect that you didn't call the Close() method right after you created the file. We can't do much without seeing the actual code you use. But anyways, here's a sample code I use when creating/writing text files:
FileStream <code>fs</code> = null;
string <code>tmpFile</code> = "C:\\sample.txt";
<code>fs</code> = File.Create(<code>tmpFile</code>, 1024);
<code>fs.Close();</code>
TextWriter <code>wr</code> = new StreamWriter(<code>tmpFile</code>);
<code>wr.WriteLine("Stuff 1");
wr.WriteLine("Stuff 2");
wr.WriteLine("Blah blah blah......");</code>
<code>wr.Close();</code>
Regards,
Polis
Can you practice what you teach?
-- modified at 9:53 Thursday 15th December, 2005
|
|
|
|
|
I want to provide operators of my C# software the opportunity to change screen resolution to optimal settings (1024x768) for viewing this particular software. How do I change screen resolution (and maintain those changed settings), should the user opt to do so?
-- modified at 11:08 Tuesday 20th December, 2005
I should have added the following. The computer that will be running the program is, in this case, a dedicated machine. It's purpose is basically to run the software I'm developing. As such, it makes a certain sense to have the display settings optimal for the particular application-should the operator opt to set them that way. The operator is under no obligation to set the computer to those optimal settings and will have the option to not see the message box again after the initial run of the program.
|
|
|
|
|
You can do this by using P/Invoke to access the Win32 API from your C# code. Have a look at the ChangeDisplaySettings function and the DEVMODE structure. You will need to create the DEVMODE structure in your code and use DllImport to call ChangeDisplaySettings. The following link documents the DEVMODE structure.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8nle.asp[^]
I hope this helps.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
What you're doing is not recommended, and, in fact, actively discouraged. Changing system-wide settings affects other applications that are running and also affects the layout of the desktop. Remember, Windows is a shared system, running multiple applications at once. You have to make sure you app works and plays nice with others. Changing system-wide settings so your app looks good, can make another app running at the same time look bad.
I know if you did that to my machine while I'm working in Maya at 1900x1440, I'd be heading straight for Add/Remove Programs and dumping your app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: I know if you did that to my machine while I'm working in Maya at 1900x1440, I'd be heading straight for Add/Remove Programs and dumping your app.
In general, agreed. THe only time forcing a resolution should be allowed is in full screen mode, and then be sure to restore the settings when the user closes or alt-tabs out of your program.
|
|
|
|
|
I want to initiate the sending of a fax from within a C# application. I want to specify the file I want to send and then launch the Send Fax Wizard allowing the user to type in the fax number, the To, etc... Does anyone know how to do this? I noticed that Send Fax Wizard does not allow for attaching files. I was able to send faxes bypassing the Send Fax Wizard all together, but that's not entirely what I need.
Many thanks.
tom d
|
|
|
|
|
here is one example
http://www.interfax.net/en/dev/c.html
|
|
|
|
|
Thanks, but that's not entirely what I need. I need to use the Send Fax windows client and prompt the user for fax number, location, etc, etc. Any ideas would be greately appreciated.
cobra2005
|
|
|
|
|
try this
http://www.codeproject.com/isapi/aspfax.asp
|
|
|
|
|
The link you've indicated has to do with sending a fax from a web page. All I want to do use COM-Object (faxcom.dll) to fax a PDF document. I want to "attach" the document to the object and fire up the Send Fax Wizard.
cobra2005
|
|
|
|
|
Hello everybody,
I want to change the cursors over all input controls (textboxes) on a form in a loop.
I tried something like:
foreach(TextBox tb in formclassname)
{
tb.Cursor = Cursors.No;
}
What's the right code to make the expected operation ?
Thank you in advance
Frank
-- modified at 11:45 Thursday 15th December, 2005
|
|
|
|
|
Assuming you are trying to change the cursors from within the form that the textboxes are on, you can try something like this:
foreach (Control tmp in this.Controls)
if (tmp is TextBox)
tmp.Cursor = Cursors.Hand;
Or like this:
foreach (Control tmp in this.Controls)
if (tmp.GetType().Name == "TextBox")
tmp.Cursor = Cursors.Hand;
Regards,
Polis
Can you practice what you teach?
|
|
|
|