|
Hi,i am in a problem to scan barcode without an active focus on a textbox. Can anyone help me? Please,do.
|
|
|
|
|
Scanning a barcode is basically the same as using keyboard. Wherever your focus is, that control will receive the input.
This property could be helpful to you: Form.KeyPreview Property[^]
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
When i minimize parent form it minimizes child form too. How can i avoid this behaviour.
Basically I have 2 forms, when a button is clicked on form1 it opens form2.show() but just before opening the form2 i am setting Form1.WindowState = FormWindowState.Minimized and this minimize the child form
I don't want to use form.TopMost becuase this way i form2 cannot be send back.
Thanks
|
|
|
|
|
It's a bit hard to say the problem without seeing the code but few issues:
- If you're using MDI parent (Form1), don't set childs MdiParent property.
- check that Form2 has WindowState set to Normal (or set it after show).
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I found some softeare, which can display the different texts in different colors.
I am wondering how to realize it in VC#.
thanks.
|
|
|
|
|
|
You can do this with the RichTextbox control.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I am publishing one project, but it gives the following error message when I run the .exe after installed the project:
(sorry the error message is given in German, in english, shortly, it means that the activation of D:\Publish\WindowsApplication6.application results in an exception. the following error is found:
+ the file C:\Users\Xia\AppData\Local\Temp\Deployment\WRVCRQEQ.H7D\P3Q37RD7.ER9\CSML.dll already exists. I am really confused, CSML.dll is the fill I refered and it is imported into D: disk and has nothing to do with C: disk. moreover, I have checked C:\Users\Xia\AppData\Local\Temp\Deployment, under this I did not find any files and no WRVCRQEQ.H7D\P3Q37RD7.ER9\CSML.dll is found. What does these message mean??
)
INFO ZUR PLATTFORMVERSION
Windows : 6.0.6000.0 (Win32NT)
Common Language Runtime : 2.0.50727.312
System.Deployment.dll : 2.0.50727.312 (rtmLHS.050727-3100)
mscorwks.dll : 2.0.50727.312 (rtmLHS.050727-3100)
dfdll.dll : 2.0.50727.312 (rtmLHS.050727-3100)
dfshim.dll : 2.0.50727.312 (rtmLHS.050727-3100)
QUELLEN
Bereitstellungs-URL : file:///D:/Publish/WindowsApplication6.application
Anwendungs-URL : file:///D:/Publish/WindowsApplication6_1_0_0_16/WindowsApplication6.exe.manifest
IDENTITÄTEN
Bereitstellungsidentität : WindowsApplication6.application, Version=1.0.0.16, Culture=neutral, PublicKeyToken=90e1acef750881e2, processorArchitecture=msil
Anwendungsidentität : WindowsApplication6.exe, Version=1.0.0.16, Culture=neutral, PublicKeyToken=90e1acef750881e2, processorArchitecture=msil, type=win32
ZUSAMMENFASSUNG FÜR ANWENDUNG
* Installierbare Anwendung.
FEHLERZUSAMMENFASSUNG
Es folgt eine Zusammenfassung der Fehler. Details zu diesen Fehlern werden später im Protokoll aufgelistet.
* Die Aktivierung von D:\Publish\WindowsApplication6.application führte zu einer Ausnahme. Folgende Fehlermeldungen wurden entdeckt:
+ Die Datei C:\Users\Xia\AppData\Local\Temp\Deployment\WRVCRQEQ.H7D\P3Q37RD7.ER9\CSML.dll ist bereits vorhanden.
FEHLERZUSAMMENFASSUNG FÜR DIE SPEICHERTRANSAKTION DER KOMPONENTE
Es wurde kein Transaktionsfehler festgestellt.
WARNUNGEN
Während dieses Vorgangs gab es keine Warnungen.
FORTSCHRITTSSTATUS DES VORGANGS
* [14.11.2008 19:39:05] : Die Aktivierung von D:\Publish\WindowsApplication6.application wurde gestartet.
* [14.11.2008 19:39:05] : Das Verarbeiten des Bereitstellungsmanifestes wurde erfolgreich abgeschlossen.
* [14.11.2008 19:39:05] : Die Installation der Anwendung wurde gestartet.
* [14.11.2008 19:39:05] : Das Verarbeiten des Anwendungsmanifestes wurde erfolgreich abgeschlossen.
* [14.11.2008 19:39:06] : Die Anforderung der Vertrauensstellung und die Ermittlung der Plattform sind abgeschlossen.
FEHLERDETAILS
Folgende Fehler wurden bei diesem Vorgang entdeckt.
* [14.11.2008 19:39:09] System.IO.IOException
- Die Datei C:\Users\Xia\AppData\Local\Temp\Deployment\WRVCRQEQ.H7D\P3Q37RD7.ER9\CSML.dll ist bereits vorhanden.
- Quelle: mscorlib
- Stapelüberwachung:
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
bei System.Deployment.Application.FileDownloader.PatchSingleFile(DownloadQueueItem item, Hashtable dependencyTable)
bei System.Deployment.Application.FileDownloader.PatchFiles(SubscriptionState subState)
bei System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
bei System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
bei System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
bei System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
bei System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
bei System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
DETAILS ZUR SPEICHERTRANSAKTION DER KOMPONENTE
Es sind keine Transaktionsinformationen verfügbar.
|
|
|
|
|
i dun know german and i won't start learning now ...
Code? Yeah i love it fried together with a glass of wine.
|
|
|
|
|
no problem if you don't know german, I have explained in english for the main problem,
could you please help me to have a look at it. thanks.
|
|
|
|
|
I have two forms. With a button on each.
The click event of the button on the first form is as follows
Form2 form2;
private void button1_Click(object sender, EventArgs e)
{
if (form2 == null)
{
form2 = new Form2();
form2.Show();
}
}
I want the button on the second form to bring back the first form on top with the
BringToFront() method. How do I access the first form as there is no variable for it.
|
|
|
|
|
|
thanx this solves the particular problem.
but I would like to know if there is anyway to get a hold of form1 from form2.
|
|
|
|
|
If you modify the form2 constructor to take a Form instance that would be form1 and keep it in your form2 instance, for further use.
|
|
|
|
|
How would I pass an instance of form1 as there is no variable for it. It is being initialized in the Program.cs
Application.Run(new form1())
method.
|
|
|
|
|
Look up this
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
public Form2(Form parentForm)
{
}
Form2 form2;
private void button1_Click(object sender, EventArgs e)
{
if (form2 == null)
{
form2 = new Form2(this);
form2.Show();
}
}
|
|
|
|
|
|
Anytime
|
|
|
|
|
humayunlalzad wrote: Form2 form2;
private void button1_Click(object sender, EventArgs e)
{
if (form2 == null)
{
form2 = new Form2();
form2.Show();
}
}
this code creates a new instance if form2 is not already opened, But what to do if form2 is opened and then closed by user(by X button of form2).
i tried in else part of your block like this
else
{ form2.BringToFront();
form2.Activate();
}
but its not working. I think when user close the form2 it got disposed, but form2 instance not set to null.
How to solve this?
thanks and regards.
|
|
|
|
|
Yes you are rt. Thanx for pointing out the prob. I tried to set form2 to null in the form2 closing event, but I dont why it's not working.
but this works
private void button1_Click(object sender, EventArgs e)
{
if (form2 == null)
{
form2 = new Form2(this);
form2.Show();
}
else if (form2.IsDisposed)
{
form2 = new Form2(this);
form2.Show();
}
else
{
form2.Focus();
}
}
The only problem is that if I want to work on form2 and close form1, form2 also closes since form2.Show() had been called. Is there a way to keep form2 running even after form1 has been closed
Guys Help
|
|
|
|
|
listen, i dont know what you are trying to achieve but use the mdi forms parent/child method instead in the future.
i dont see the purpose of using many forms (or use usercontrols like pages).
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Its just about understanding the mechanism. But thanx anyways.
|
|
|
|
|
listen,
if you are studying that method ok, go ahead, but like i said if you are trying to build some kind of application and you are thinking on using that method...drop it
i create applications using a single form!!! then a fill the form with lots of usercontrols that are pages.
Or you can use mdi parent/child form method.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi guys, I want to resize the custom control if i select the bottom left handle on the control and drag it so it can be resize. The problem is that through the bottom left handle when the custom control size reaches 20 and if further drag up the custom control doesn't change its size but it starts to move horizontally.
Can you please point me where i am doing wrong. Thanks.
private void Nodes_MouseMove(object sender, MouseEventArgs e)
{
if(NodeLocation.BottomCenter=="BottomCenter")
{
bottomCenter(n, e.X, e.Y);
}
else
{
bottomLeft(n, e.X, e.Y);
}
}
private void bottomCenter(Nodes n, int x, int y)
{
Control c = (Control)n.Tag;
n.Location = new Point(n.Location.X, n.Location.Y + y);
c.Height = c.Height + y;
}
private void bottomLeft(Nodes n, int x, int y)
{
Control c = (Control)n.Tag;
n.Location = new Point(n.Location.X + x, n.Location.Y + y);
if(c.ClientRectangle.Width > 20 && c.ClientRectangle.Height > 20)
{
c.Left = c.Left + n.Left;
c.Height = c.Height + y;
c.Width = c.Width - n.Left;
}
else
{
if( n.Left + c.Left > 20 ) ----> when button size reaches 20 and wants to ruther decrease it size then button moves horinontally {
c.Left = c.Left + n.Left;
c.Height = c.Height + y;
c.Width = c.Width -n.Left;
}
}
}
modified on Friday, November 14, 2008 12:12 PM
|
|
|
|
|