|
You can find what you want if you simply go to C# section and check for Grid Controls, inserting a control into a grid is the same as a listbox you simply have to change the control's class only,i could have given you an example but all my code is based on libraries code
I've been programming since year 1999, graduated from Univeristy Paris 2 France, fluent in C,C++,VC++,Web programming (XML,HTML,php etc..),.NET frameworks,C# and ASP.NET,SQL server, Mastering VC++ .NET and SQL server,data structure and database design
|
|
|
|
|
Hi,
I have solution with 10 class library and 1 web service. When I created set up project(.msi) in 2003 it works fine but after converting all the project to .net 2.0 (2005) even though conversion worked fine. I created new set up project which creats virtual directory and puts all the files there but I am getting all sort of erros with web.config. when i replace web.config with old file i am getting errors with global.asax.
Any idea?
Thanks
|
|
|
|
|
I have called a crystal report9 in c#.It displays some data and line chart(graph) well.Now i want to change this line chart to bar graph on mouse click or on mouse over in C#.what should I do.Any expert having idea about my problem?PLz tell me solution
|
|
|
|
|
I just want to know is there any way to get the contents of a requested web page & edit it ( all the images & other multimedia files be replaced by links which when clicked displays those replaced objects in their places) wduring runtime in a C#.NET windows application.
|
|
|
|
|
In short yes.
Without writing the whole code for you (only because i am short of time) you need to create an System.Net.HttpRequest object.
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("thewebpageyouwanttoget");
set the method to post and content type and any values you need and then get a webresponse back by calling
WebResponse resp = req.GetResponse()
to get the HTML of the resulting webpage just pass it into a streamreader
StreamReader sr = new StreamReader(resp.GetResponseStream())<br />
string theWebPage = sr.ReadToEnd();
Now you have the full html of the webpage in a string.... just do your search and replaces there and then pass it to your form to display.
|
|
|
|
|
Can u please explain the technique with an example,also i want to know how to display the html content of the string as a web page without using the Microsoft Browser object.
|
|
|
|
|
if i have a control which contains a list of items that do not fit the window, how can I display only a part of it? How must I define the control? (Also it must be a custom scroll)
|
|
|
|
|
If your control inherits from UserControl just set the Atutoscroll property to true. This way scrollbars will automatically shown when any of the controls inside your control does not fit completely in.
|
|
|
|
|
As I said, it must be a custom scroll. It must have a particular design.
|
|
|
|
|
If you can describe the particular design to us, perhaps we can help more.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hi guys.
how do u enable all cells for labeledit?
thanks
|
|
|
|
|
Hi!
Simple: You cannot (out of the box).
Take a look here[^] for a solution.
Regards,
mav
|
|
|
|
|
|
when i try to send an email it give me the following error:
"Could not access 'CDO.Message' object"
My code was:
EmailForm frm = new EmailForm();
if(frm.ShowDialog() == DialogResult.OK)
{
frm = null;
MailMessage mailObj = new MailMessage();
mailObj.From ="ME";
mailObj.To = to;
mailObj.Cc = cc;
mailObj.Bcc = bcc;
mailObj.Subject = subject;
MailAttachment mailAtt = new MailAttachment(Path);
mailObj.Attachments.Add(mailAtt);
mailObj.Body = "Body Text!!!";
mailObj.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = Dns.GetHostName();
try
{
SmtpMail.Send(mailObj);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"Error");
}
}
Can u help me on this.
thanks.
|
|
|
|
|
This could be an authentication issue. Try providing more details to the account you want to use to send the email. I have found this from Microsoft and it helped me. You may want to try it too:
try
{
string smtpServer = "mail.mystmpserver.com"; //your smtp server here
userName = "myaccount@mystmpserver.com; //your account info here
password = "mypassword"; //your password
int cdoBasic = 1;
int cdoSendUsingPort = 2;
MailMessage mail = new MailMessage();
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) ;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort) ;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);
mail.To = "emailaddress@server.com" ; // if you want to send it to multiple email address separate them using semicolon
mail.From = "emailaddress2@server.com" ;
mail.Subject = "Subject here";
mail.Attachments.Add("file here");
mail.BodyFormat = MailFormat.Html;
mail.Body = "<b>This is a bold text in the body of the mail.</b>"
SmtpMail.SmtpServer=smtpServer;
SmtpMail.Send( mail );
Label1.Text="Message Sending successful";
}
catch(Exception ex)
{
Label1.Text="Message Sending failed! Error: " + strerror ;
}
|
|
|
|
|
I am writing a simple event based socket thingy (not sure of the word), and I want the code to be as portable as possible, aka Mono. Mono has no Windows.Forms and I am using System.Windows.Forms.Timer, I am wondering if their would be a way to make my own timer (mabye using threading).
Thanks in advanced!
|
|
|
|
|
There is another Timer class in .NET. Try this one...
System.Timers.Timer
|
|
|
|
|
Mono now has Windows.Forms, they just are missing some of the advanced controls like DataGrid or the new .NET 2.0 controls.
|
|
|
|
|
Really? How do you access it? would it be a comand line option like: /reference:System.Windows.Forms?
|
|
|
|
|
Yes, it's a normal .NET assembly. Windows applications compiled with Microsoft's CSC will work using Mono (when they only use controls that are supported by Mono), no need to recompile.
|
|
|
|
|
Sweet, Thx! And It works very well in Windows, but my Gentoo died
|
|
|
|
|
hohsin01@yahoo.com.sg or hohsin10@hotmail.com
What's bad??? Pls help me, I do not have techar. Yor are ONE. Thanks!!!
Error 1 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 24 33 Test012
Error 2 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 57 32 Test012
using System;
using System.Collections.Generic;
using System.Text;
using Wrox.ProCSharp.OOCSharp.BankProtocols;
using Wrox.ProCSharp.OOCSharp.VenusBank;
using Wrox.ProCSharp.OOCSharp.JupiterBank;
namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balace
{
get;
}
}
}
namespace Wrox.ProCSharp.OOCSharp.VenusBank
{
public class SaverAccount : IBankAccount
{
private decimal balace;
public void PayIn(decimal amoount)
{
balance += amount;
}
public void Withcraw(decimal amoount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Writdraw attemp failed");
return false;
}
public decimal Balanc
{
get
{
return balace;
}
}
public override string ToString()
{
return String.Format("Veuns Bank Saver : Balace = (0,6:C)", balance);
}
}
}
namespace Wrox.ProCSharp.OOCSharp.JupiterBank
{
public class GoldAccount : IBankAccount
{
//Console.WriteLine("Writdraw attemp failed");
}
}
namespace Test012
{
class Program
{
static void Main(string[] args)
{
IBankAccount venusAccout = new SaverAccout();
IBankAccount jupiterAccount = new GoldAccount();
venusAccount.PayIn(200);
venusAccount.Withdraw(100);
Console.WriteLine(venusAccount.ToString());
jupiterAccount.PayIn(500);
jupiterAccount.Withdraw(600);
jupiterAccount.Withdraw(100);
Console.WriteLine(jupiterAccount.ToString());
}
}
}
----------------------------------------------------------------------------
Help me, you are one!!!
Error 1 Invalid token 'interface' in class, struct, or interface member declaration C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Test014\Program.cs 11 15 Test014
//Professional C# 2nd Edition -> Pg.128
using System;
using System.Collections.Generic;
using System.Text;
namespace Test014
{
class Program
{
pulic interface IBankAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balance
{
get;
}
}
public class CurrentAcconunt : ITransferAccount
{
private decimal balance;
public void PayIn(decimal amount)
{
balace += amount;
}
public bool Withdraw(decimal amount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Withdrawal attempt failed.");
return false;
}
public decimal Balance
{
get
{
return balance;
}
}
public bool TransferTo(IBankAccount destination, decimal anount)
{
bool result;
if((result = Withdraw(amount))== true)
destination.PayIn(amount);
return result;
}
public override string ToString()
{
return String.Format("Jupiter Bank Account: Balance = {0.6:C}", balance);
}
}
static void Main(string[] args)
{
IBankAccount venusAccount = new SaverAccount();
ITransferBankAccount jupiterAccount = new CurrentAccount();
venusAccount.PayIn(200);
jupiterAccount.PayIn(500);
jupiterAccount.TransferT(venusAccount,100);
Console.WriteLine(vernusAccount.ToString());
Console.WriteLine(jupiterAccount.ToString());
return;
}
}
}
|
|
|
|
|
Eddy Ho wrote: namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount
{
void PayIn(decimal amount);
Do you see something wrong with this? A little spelling error perhaps?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Don't ever send an email to someone who doesn't ask you to. Keep this in the forums at all times.
Let me make it a little simpler. The error you're getting says that "The type or namespace name 'IBankAccount' could not be found".
Do you see something wrong here:
namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount <<<<<<<----- CLUE !!!
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balace
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 13:14 Saturday 14th January, 2006
|
|
|
|
|
Hello all!
I am using a C# program and would like to compress some files make zip file by coding. Can anyone provide some help. I look for msdn but not found.
Thanks All,
Tran Dung
-- modified at 21:49 Friday 13th January, 2006
|
|
|
|