|
Because I have already explored all the articles and concluded my solution on the basis of the best implementations.
All work good but not with the scenirio, I'm facing "The Hidden Form"
By the way, I'm interested in Vista Develpement Specially, WPF and WCF. Any guide lines?
Best Regards,
Rizwan Ahmed.
|
|
|
|
|
I am using a Deployment project to deploy my C# application (VS 2003). In the Uninstall event I want to get the installation directory that was selected by the user when they installed the program but can't seem to get this.
Application.StartUp path returns the path to the msi file that is executing not the installation directory.
|
|
|
|
|
Hello Devs,
I'm facing a very strange problem in Windows Form Application using Visual Studio 2005.
I have a lot of controls on my Windows Forms like TableLayoutPanels, TextBoxes, RichTextBoxes, Buttons.
I set their TabIndexes appropriatley from 0,1,2,3.....
When I run the application The cursor focus is not on the control whoes TabIndex Property is se to zero .
I need to Focus myself on the control I want to be focued when application runs.
I'm stucked with this for more than 6-7 hours, Removed all the resource file Entries of TabIndex and set all of them again. (Didnot work).
Tried to Set focus on tha control in Form's Load event (Didnot work too).
Also Saw the Property in Form's Load even that if that control can be focused using Control.CanFocus (Always Returns false).
Please tell me something about this Bull S***
Its a pain in A** for me at this time.
I'll be really thankful to you for your help.
Best Regards,
Rizwan.
|
|
|
|
|
I once had the same problem. I had to put the focus on the control I wanted with control.BringToFront();
I don't know why the TabIndex sometimes don't work with VS2005, but I didn't found the error. After I reinstalled the computer (and VS2005) it worked fine.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Hmm, Its impossible to reinstall all the things again. But yes you are so true this is some bug with VS 2005 coz my friends also complained me about this when i discussed my problem with him.
Anyways there are 2 possibilities:
1) I Compile it at some other computer.
2) I use the method you used control.BringToFront();
Can I put control.BringToFront(); in Form's Load Event?
Can you explain the code:
Should I use this:
control.BringToFront();
control.Focus();
in Form's Load Event?
Thanks a lot for your reply,
Best Regards,
Rizwan
|
|
|
|
|
tried this: (Didnot work)
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.BringToFront();<br />
}
Nor this:
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.BringToFront();<br />
rtfSend.Focus();<br />
}
Nor this One:
private void FrmServer_Load(object sender, EventArgs e)<br />
{<br />
rtfSend.Focus();<br />
rtfSend.BringToFront();<br />
rtfSend.Focus();<br />
}
Any Help??
Thanks a lot
Best Regards,
Rizwan
|
|
|
|
|
That's strange, but I don't get the same error now, so I can't test it.
Sorry,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Ahhhh! Ok, Thanks.
But are you sure Windows and Visual Studio Reinstallation can fix this problem
I think this configuration may only reside in Resource files which i refined clearly but not working :->
Thanks a lot,
Regards,
Rizwan
|
|
|
|
|
dotnetdev83 wrote: But are you sure Windows and Visual Studio Reinstallation can fix this problem
No sorry I'm not sure. For me it worked, but I don't know if our problems have the same cause.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
It might be a good idea to look at the control that IS getting focus when you load your form.
Is it a panel? I've had to set the TabStop property to false on a panel before, even though it had a high tab index.
|
|
|
|
|
Yes,
I have tried all the things, I set all the panels and all oher controls' TabStop property to false.
But again the same proble.
When I run the application, The focus of the control must be at the control whose TabIndex is 0 rather it focuses control with TabIndex 2.
When I try check CanFocus property of Controls with TabIndex 0 in Form's Load it returns false.
I want to know the reason what's the reason behind "Control.CanFocus is always false". How does it evaluate this that it cannot be focused. If i know this then may be we can solve the problem.
Thanks alot,
Best Regards,
Rizwan Ahmed.
|
|
|
|
|
hi all i have this pro on hand now.. i have downloaded some sample database applications from the internet..however when i want to debug it i gives me the error--An unhandled exception of type "system.Data.OleDb.OledbException" occurred in system.data.dll
does this errors occur due to where the dB file is located..is it correct? can someone out there help will this pro? and maybe guide me to correcting it ..thanks in advance..
an extract on of codes where the problem is highlighted is below:the pro is bold...thanks in advance
private void fclsMain_Load(object sender, System.EventArgs e)
{
m_cnADONewConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\contacts.mdb";
m_daDataAdapter =
new OleDbDataAdapter("Select * From Contacts",m_cnADONewConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtContacts);
this.ShowCurrentRecord();
|
|
|
|
|
You need
cnADONewConnection.Open();
before
m_daDataAdapter.Fill(m_dtContacts);
|
|
|
|
|
DataAdapter handles the open and close connection in the Fill method
only two letters away from being an asset
|
|
|
|
|
What is the message in the exception? This will tell you (and us) more of what is going on.
only two letters away from being an asset
|
|
|
|
|
Here is my problem
I want to print the contents of the datagrid c# in ASP.NET 2.0 but the constraints are:
1>When the user clicks the print button all the records till the end even the data is not visible to the user should get print.
2>It should print according to the page size that is the user tells how many records has to be dispalyed at a time on a webpage.
3>At every page the page header and footer sholud be displayed defined by the user
4>How to access the page footer and header programatically inorder to avoid to print the url at the end of the page.
Does any one knows the solution please reply it's urgent!
sunny
|
|
|
|
|
Hi,
you are in the wrong board. ASP.NET Question should be asked in ASP.NET Board. Secondly you just use a subject that is corresponding to the problem and not just "hi". Use a subject as: "Printing a datagrid"
I can't help you, as I don't have an active ASP project and my last one was mutiple month ago.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
I need to run zip a file(s) using winzip from within my c# application. Can anyone point me to documentation / example of how to accomplish that. Thanks in advance - SS -
|
|
|
|
|
|
Then include the J# libraries and you can do it programmatically.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Why zip with winzip when you can do it in code: SharpZipLib[^]
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
If I have an xml file such as below:
<printItAll>
<chatMessage>
<xml1>username</xml1>
<xml2>message here!</xml2>
<xml3>red</xml3>
<xml4>arial</xml4>
<msgID>3</msgID>
</chatMessage>
<chatMessage>
<xml1>Ben Griffiths</xml1>
<xml2>some random message</xml2>
<xml3>red</xml3>
<xml4>arial</xml4>
<msgID>4</msgID>
</chatMessage>
</printItAll>
How would I count the <chatMessage> elements, and how could I loop through them? At the moment my file only reads the first one. Here is my current code:
XmlDocument xDoc = new XmlDocument();
xDoc.Load("my_xml_file.xml");
XmlNodeList xml1 = xDoc.GetElementsByTagName("xml1");
XmlNodeList xml2 = xDoc.GetElementsByTagName("xml2");
XmlNodeList xml5 = xDoc.GetElementsByTagName("msgID");
string chat_memberU = (xml1[0].InnerText + ": ");
string chat_message = (xml2[0].InnerText);
int latestID = Int32.Parse(xml5[0].InnerText);
Many thanks, Ben.
-- modified at 11:19 Thursday 3rd August, 2006
|
|
|
|
|
SoftcodeSoftware wrote: count the <chatmessage> elements
Retrieve the Count property of one of the XmlNodeList s.
SoftcodeSoftware wrote: how could I loop through them?
Iterate over the XmlNodeList s you've already got.
"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
|
|
|
|
|
Hi, thanks,
I actually realized it was in an array just now lol, got it working
|
|
|
|
|
I have a code that monitors the electrical loop. Once the button is pressed, it would loop until the button is pressed. The problem is that when the code loops (I use while loop), the button cannot be pressed and the programs acts like as if it is locked up. How do I get the program check for any event while looping? Like for example, in borland c++, it uses "Application->ProcessMessages()".
How do I apply this to Visual Studio.NET?
-- modified at 11:16 Thursday 3rd August, 2006
Code sample below:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
namespace loop_test
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.NumericUpDown numUpDn;
private System.Windows.Forms.Button btnLoop;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.btnLoop.BackColor = System.Drawing.Color.Red;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnLoop = new System.Windows.Forms.Button();
this.numUpDn = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.numUpDn)).BeginInit();
this.SuspendLayout();
//
// btnLoop
//
this.btnLoop.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnLoop.Location = new System.Drawing.Point(56, 16);
this.btnLoop.Name = "btnLoop";
this.btnLoop.Size = new System.Drawing.Size(176, 96);
this.btnLoop.TabIndex = 0;
this.btnLoop.Text = "Loop Stopped";
this.btnLoop.Click += new System.EventHandler(this.btnLoop_Click);
this.btnLoop.BackColorChanged += new System.EventHandler(this.btnLoop_BackColorChanged);
//
// numUpDn
//
this.numUpDn.Location = new System.Drawing.Point(72, 136);
this.numUpDn.Name = "numUpDn";
this.numUpDn.TabIndex = 3;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 174);
this.Controls.Add(this.numUpDn);
this.Controls.Add(this.btnLoop);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Loop interruption Test";
((System.ComponentModel.ISupportInitialize)(this.numUpDn)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void btnLoop_Click(object sender, System.EventArgs e)
{
if (this.btnLoop.BackColor == System.Drawing.Color.Red)
this.btnLoop.BackColor = System.Drawing.Color.Lime;
else
this.btnLoop.BackColor = System.Drawing.Color.Red;
}
private void btnLoop_BackColorChanged(object sender, System.EventArgs e)
{
while (this.btnLoop.BackColor == System.Drawing.Color.Lime)
{
this.numUpDn.Value += 1;
this.numUpDn.Update();
Thread.Sleep(500);
}
}
}
}
|
|
|
|