|
Hi,
I have created a simple C# application that has a Windows form. The form contains a richtextbox and a button. I want that at run time, when I type something in the text box and click after that on the button, another form should pops up. Is it possible??
If yes, then any assistance would be appreciated. I have also added another form but dnt know how to add it in the button_click().Please let me know if you need further info.
<pre>
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
toolStripButton8_Click(null, null);
}
private void toolStripButton8_Click(object sender, EventArgs e)
{
toolStripButton8.Click += new EventHandler(toolStripButton8_Click1);
}
void toolStripButton8_Click1(object sender, EventArgs e)
{
//Load Form2 here
}
</pre>
Regards
Ethen
|
|
|
|
|
First you should create new instance of another form. Then show it by calling either Show() or ShowDialog()
|
|
|
|
|
Thanks Giorgi...It works
Cheers
Ethen
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi,
I am now able to invoke second form through the first form. However, there is a small issue. As per the application, I have to close form2 and click the button to show the form 2. I have to do this thrice
It happens twice successfully but for the third time, when I click the button, multiple form2 shows up and fills the desktop screen. how do I fix this?
Cheers,
Ethen
|
|
|
|
|
Hello
1) ComboBox is Visible False
2) When User Click on TextBox, i am Changing the Visible State of Combo to True
3) Now I am trying to Set Focus on Combo Box But It will not doing so.
--- cmbCity.Focus();
Any Way to Solve my Problem
Best Regards,
Chetan Patel
|
|
|
|
|
|
i have used this.
List<string> strTemp=new List<string>;();
how can i achieve the same in HashTable, like
HashTable<string,int> strTemp=new HashTable<string,int>();
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Try Dictionary.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Inherit HasTable Class and Create Your Own Class with Add and Get Methods
And Check For the Values in Custom Methods.
Best Regards,
Chetan Patel
|
|
|
|
|
.NET 2 introduced the Dictionary generic, so this would be achieved using:
Dictionary<string,int> strTemp=new Dictionary<string,int>(); The only thing to watch out for is how to access it. In order to iterate over the Dictionary, you use the KeyValuePair generic, so you would end up with something like this:
foreach (KeyValuePair<string,int> item in strTemp)
{
}
|
|
|
|
|
The generic version of the HashTable is the Dictionary:
Dictionary<string, int> temp = new Dictionary<string, int>();
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
What is the reason for the StackOverFlowException and AccessViolationException
and the solutions for these errors in windows application + C#.net 2.0
|
|
|
|
|
They're pretty self explanatory, but here goes.
tauras81 wrote: StackOverFlowException
This occurs when the stack overflows. There is a limited number of methods that can be called, so the most common occurance of this exception is when you keep calling the same method over and over again. The most common time i see this exception is when I make a case-related typo eg
public class Foo
{
private int bar;
public int Bar
{
get{ return this.Bar; } <-- that should have said this.bar. By being uppercase it will keep calling itself. StackOverflowException will occur
}
}
tauras81 wrote: AccessViolationException
This exception is usually thrown when trying to read or write protected memory. It has to do with unsafe or unmanaged code, and as I dont deal with this very often I cant think of a simple reproducable bit of code to demonstrate it. You could try the documentation[^] - a good place to go in both these cases.
|
|
|
|
|
This error occurs when
--- We have called any function or Property from Itself
When we are calling function it saves current function's state in Stack Memory
But when we call recursively(infinite) then it results in overflow of memory.
Best Regards,
Chetan Patel
|
|
|
|
|
hi there!! I have an issue with the PrintPageEventHandler function. There are two parameters what are coming with the function(object and PrintPageEventArgs), I want to add one more parameter, XmlDocument, but when I am trying to do that, I am receiving an error: No overload for PrintPageEventHandler matches delegate "System.Drawing.Printing.PrintPageEventHandler". Is there anyway how I can put some other parameter for this handler or no? Thx ahead
|
|
|
|
|
Good morning good cpians
DataTable dt = new DataTable("SomeTable");
string[] tokens;
dt.Columns.Add("ID",typeof(int));
dt.Columns.Add("Name",typeof(string));
StreamReader sr = new StreamReader("C:\\SomeFile.csv");
while (!sr.EndOfStream)
{
tokens = sr.ReadLine().Split(',');
if (tokens.Length == 2)
dt.Rows.Add(tokens);
string strExpression = "ID = 1";
DataRow[] dr = dt.Select(strExpression);
MessageBox.Show(dr[0].ToString());
I've been posting this since yesterday and I still need it to be as I wrote it "DataTable is filled out of a file that makes it ambiguous to decide what type the value is" as seen from my example, can you please try it with my exact code and tell me what modification I would need?? Cuz I think the problem is in the way I'm storing data not in filtering it!
ps. I should also be able to apply other operands like < and > and concatenate them with variable values.
Many thanks guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks I've done it the other way round
double d_ID = Convert.ToDouble(MyDataRow["ID"].ToString().Trim())
if (d_ID == 0)
MessageBox.Show(d_ID.ToString());
But still interested to know the answer for more complex select statements
Thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
using System.Configuration;
static void ShowConfig()
{
foreach (string key in ConfigurationManager.AppSettings)
{
string value = ConfigurationManager.AppSettings[key];
Console.WriteLine("Key: {0}, Value: {1}", key, value);
}
}
get an error The name'ConfigurationManager' does not exist in the current context.
Can anyone help?
|
|
|
|
|
You need to add reference to System.Configuration
|
|
|
|
|
Another error :Configuration system failed to initialize.
Please help.
|
|
|
|
|
Perhaps the file is malformed.
|
|
|
|
|
Hi, i 've a question about calendar control in visualstudio 2005. I need to use different buttons for next and prev month but NextPrevStyle has only 1 CssClass... how can i do it? thx!!!!
|
|
|
|
|
Axelaser wrote: CssClass
And that means you are in the wrong place. Head off to the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|