|
The first thing that i would like to know is y do u want to display 2 forms at one time in ur application. I think the flow should be such that only one form is accessible at one time.
But even then if u want to do it then it seems to be a tricky one
need to try this
i'll try if this is possible and then let u know
Regards,
Pramod
|
|
|
|
|
Hi,
can u tell me from where does ur form 2 gets the call to
display?
if it's from form1 then u cannot solve it
but if form2 is called from some other form u can access it.
Please send the details what is ur application about
i have tried it.
Regards,
Pramod
|
|
|
|
|
thanks for your reply!
Actually, it's a windows application but Internet Explorer hosted so the one that loads the forms is the IE.
there will be an instance/scenario that you want to open more than one forms at a time, for some transaction purposes to validate some data. Anyway, so for example there would be an error occured or a message asking for confirmation for something in one of the openned forms(that's where the messagebox comes in the picture), then when you don't want to close the messagebox yet and go to the other forms or launch another, you can't do that because the messagebox is modal for the whole application.
so that's the purpose of the customized messagebox.
hope that's what you want to know.
thanks for your time!
microsoc
|
|
|
|
|
I'm looking for any topic or code that can help me understand xls parsing. I'm trying to read from excel file, re-format some data and save it to xls file again. I'll be really really thankful for any kind of help.
|
|
|
|
|
http://swish-e.org/archive/2005-06/9778.html
|
|
|
|
|
Hello everybody,
I've created a filesystemwatcher in windows service. I want to store files that have been changed into MS Access. The problem is the data is not inserted into database after the event handler is fired. Any suggestion that can solve this problem?
Thanks in advance,
hongweng
|
|
|
|
|
If you pop a break point in the event handler, is it actually getting fired? One thing I found, especially with MS Word files, is that some applications use temporary swap files that get copied over the original file (the $WSwhatever.doc files in word, for example). This raises a Rename event on the fileSystemWatcher rather than a save.
|
|
|
|
|
I am working on a web chat application that is using Sockets. when a client application recieves message from server application its method is call back named OnDataRecieved(IAsyncResult asyn). but when data is recieved on the client side it does not show tha value of data recieved in textbox, the reason behind is that page is not being refreshed. OnDataRecieved() method is as follows:
public void OnDataReceived(IAsyncResult asyn)
{
try
{
SocketPacket theSockId = (SocketPacket)asyn.AsyncState ;
int iRx = theSockId.thisSocket.EndReceive (asyn);
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
System.String szData = new System.String(chars);
bool chk = false;
//
if (szData=="|\0")
{
chk_list=false;
Object objData = '~' + txtname.Text + '\n';
byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString ());
if(m_clientSocket != null)
{
m_clientSocket.Send (byData);
}
}
else
{
if (chk_list==false)
{
listBox1.Items.Clear();
chk_list=true;
}
if (szData== "~\0")
{
chk = true;
chk_msgtype=true;
}
//
if (chk == false)
{
str+=szData[0];
}
if (szData=="\n\0")
{
if(chk_msgtype == true)
{
listBox1.Items.Add(str.ToString());
chk_msgtype=false;
}
else
{
if (richTextRxMessage.Text!="")
{
/*richTextRxMessage.Text += str;
a.Text=str;
Label1.Text = "1234";*/
Session.Add("message",str);
Response.Redirect("SocketClient.aspx");
//Response.Write(str);
}
else
richTextRxMessage.Text=str;
//richTextRxMessage.Text+="\n";
}
str="";
}
}
WaitForData();
}
when this method calls Response.Redirect("SocketClient.aspx"); it provides followingg error.
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Response is not available in this context.
I want my page to be postback after this method is called but response.redirect is not working. can anybody tell me y isnt it working and how can i perform the same task
|
|
|
|
|
Have you tried System.Web.HttpContext.Current.Response.Redirect("SocketClient.aspx")?
|
|
|
|
|
That won't help.
The problem is not that the Response object isn't reachable, the problem is that it's not available at all.
The Response object is only available in code that is actually creating a response.
---
b { font-weight: normal; }
-- modified at 3:49 Tuesday 24th January, 2006
|
|
|
|
|
the problem is there is no request generated, but i want my page to be rereshed from but i dont know how and i want ideas to do that
|
|
|
|
|
Hi,
I want the code in C# for pinging the system constantly and get back the alert when the target system is down which says that "Service Unavailability" of the target computer. Kindly guide me in solving this issue.
Thanking you in Advance,
Venkat.
|
|
|
|
|
the ping command of the system returns
"Reply from ..." if the system that is pinged is working or on.
and returns
"Request Timed out.." if the system is \switched off
now u need to write a thread and execute this ping command in that thread
and break the thread when u receive the Request timed out message
and display that to the user.
Regards,
Pramod
|
|
|
|
|
|
Hi, howzit.
I have a 2003 solution that I trying to open in VS 2005 but it keeps giving me this error message:
"Cannot be converted because it cannot be modifyed. To convert it change the permissions on the solution file to allow modification and re-open it"
How do I change the permissions on the solution file?
Thanks,
|
|
|
|
|
Check to see if the file is read only.
|
|
|
|
|
I tried that the first time, but it obviously did not change all the files to read/write, but now when I tried again it works, thanks man!
|
|
|
|
|
Hi, I have created a program first as a console application. Then I created a windows application and copied the class data there. It is shown below. In the console application, I have used the printData() method to output the data of an instance of a Person or Athlete class. I want to do the same, but now that output should be in the label. I have created the printWindows data() function but when I call it from the main function in the for loop it doesn't work.
Any help would be appreciated.
namespace windowsPracticingWithClasses
{
///
/// Summary description for Form1.
///
public class Person : System.Windows.Forms.Form
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
//My instance variables
private string firstName, lastName;
private int age;
private double height, weight;
private string bankName;
private double bankAccount;
private double balance = 0;
private string squareColor;
# region Properties
//Properties
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
and other properties.....
#endregion
//Custom constructor
public Person(int age, double height, double weight, string bankName, double bankAccount, double balance)
{
InitializeComponent();
this.age = age;
this.height = height;
this.weight = weight;
this.bankName = bankName;
this.bankAccount = bankAccount;
this.balance = balance;
}
public virtual void printData()
{
Console.WriteLine("\nProfile: \n\nAge: " + this.age);
Console.WriteLine("Height: " + this.height);
Console.WriteLine("Weight: " + this.weight);
Console.WriteLine("Bank Name: " + this.bankName);
Console.WriteLine("Bank Account: " + this.bankAccount);
Console.WriteLine("Balance: " + this.balance);
}
public void printWindowsData()
{
label1.Text += "Age: " + this.age;
label1.Text += "\nHeight: " + this.height;
label1.Text += "\nWeight: " + this.weight;
label1.Text += "\nBank Name: " + this.bankName;
label1.Text += "\nBank Account: " + this.bankAccount;
label1.Text += "\nBalance: " + this.balance;
}
class Athlete : Person
{
public string sport;
public Athlete(string sport) : base(23,5.6,120,"Chase",5671234,1000)
{
this.sport = sport;
}
public override void printData()
{
base.printData();
Console.WriteLine("Sport Practicing: " + this.sport);
}
};
class TestClasses
{
[STAThread]
static void Main()
{
Application.Run(new Person());
Person[] person = new Person[5];
person[0] = new Person(22,5.6,120,"Chase",5671234,2000);
person[0].printData();
Person[] athlete = new Athlete[3];
athlete[0] = new Athlete("Martial Arts");
athlete[0].FirstName = "Kim";
athlete[0].LastName = "Chung";
athlete[0].Age = 21;
athlete[0].Height1 = 5.7;
athlete[0].Weight = 130;
athlete[0].BankName = "Citi";
athlete[0].BankAccount = 212312;
athlete[0].Balance = 300;
for (int i = 0; i < athlete.Length; i++)
{
athlete[i].printWindowsData();
}
|
|
|
|
|
can u be more specific wht problem u r facing
does the label text goes blank or displays some text.
here u have used console.writeline
is ur project type Console or Windows Application?
check the project properties.
Regards,
Pramod
|
|
|
|
|
Hi, The initial program was in console application. That is where I used the printData() function. Then I decided to switch to windows application and show all the data in a label. The problem is that when I call athlete[i].printWindowsData in the for loop I see blank. No text is shown. However when I call the printWindows data from the Person constructor it shows the data but only what I passed to the constructor. I would like to see the whole array to be shown in a label.
Thank you.
|
|
|
|
|
Actually in Windows application u have created a class called TestClass
and called the person class in the main method,
this is not the correct way, us should create a form for that Test class
and then create the object in this class and use the same object for displaying the contents.
The problem is u have passed a variable in the
Application.run(new Person());
and u dont have reference to this object.
Hope u get this and that works for u
Regards,
Pramod
|
|
|
|
|
Thanks for your reply. Can you tell me how can I create a form for the TestClasses, and what to do next to make the array class be shown in the label?
|
|
|
|
|
first thinf is that dont create the Person class as a form,
Remove the inheriting statement i.e. System.Windows.Forms.Form from the
definition of the person class.
and then create the test class form and create the Array of the Person class and set the properties of the array objects and then display them in the label.
Hope u get it
Regards,
Pramod
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
It Doesn't show anything in the label. I would like to see the data stored in the array in the label.
Thank you.
-- modified at 15:42 Tuesday 24th January, 2006
|
|
|
|