|
As a side note, (for what it's worth)
If I remove the 1st image listed (kopf.jpg) from the directory (i.e. I delete the jpg file), the whole program doesn't work. :S
|
|
|
|
|
I'm thinking about writing a simple alarm clock for myself so I've just been doing some research looking at how some other ones have been desinged and most programs I've looked at use a timer to check if an alarm time has been hit. I'm just wondering if this is the best way to do it or if there is another way that would accomplish the same thing.
Thanks for the information.
- Aaron
|
|
|
|
|
monrobot13 wrote: use a timer to check if an alarm time has been hit
That seems about right. You could get by with a single (reasonably high resolution - eg: < 1 Sec.) timer or one timer per alarm (assuming you can have multiple alarms). A single timer is of course less resource intensive.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thanks very much for the info.
- Aaron
|
|
|
|
|
I have large child panel control Im using for a direct3D render engine. I want to use the balloon tooltip when they mouse over XY locations on the child panel. I want to use the popup event already in the ToolTip control to check whether their over an acutual item or not.. if not.. bail out...
my problem is.. the ToolTip only shows up once... popup only gets called once.. im not surprised because its one big control and Im still within its bounds.. but is there anyway around this?
|
|
|
|
|
I need create in code file, some code for read text file, that contain a string of connection of my database like that
Data Source=(local);Initial Catalog=IUSA;Integrated Security=True
and put that string in a public variable for use in all the project, but i need some idea about that, because in vb.net, i used that, how can do that in C#
Module CONECTA
Public cadenaconexion As String
Public pcodpro As String
Public pcodcli As String
Public pnomcli As String
Public pprecio As String
Public pexipro As String
Public tb As New TabControl
Public P2 As New Collection
Public tcodpro As TextBox
Public cndb As New SqlClient.SqlConnection
Public cndb1 As New SqlClient.SqlConnection
Public cndb2 As New SqlClient.SqlConnection
Public usuario As String
Public fechafactura As String
Public tdoc As String
Public PrmPathExcelFile As String
Public consultaclientes As INQCUSTOMER
Public consulta As PRODIQ1
Public factura As MTTOFAC
Public fmtfecha As FMTDATE
Sub main()
Dim myStreamReader As System.IO.StreamReader
Dim myInputString As String
Try
myStreamReader = System.IO.File.OpenText("C:\SQLCONECTA.TXT")
myInputString = myStreamReader.ReadLine()
Catch exc As Exception
MsgBox("Archivo de Conexion no se Puede Abrir o no Existe." + vbCrLf + _
"Por favor Verifique Que el Archivo Este Bien, " + _
vbCrLf + "Exception: " + exc.Message)
Finally
If Not myStreamReader Is Nothing Then
myStreamReader.Close()
End If
End Try
cadenaconexion = myInputString
cndb.ConnectionString = cadenaconexion
cndb1.ConnectionString = cadenaconexion
cndb2.ConnectionString = cadenaconexion
Dim ACCESO1 As New ACCESO
ACCESO1.ShowDialog()
End Sub
End Module
|
|
|
|
|
Just do it the same way. The framework is still the same, so the System.IO namespace still works exactly the same.
---
b { font-weight: normal; }
|
|
|
|
|
Out of curiosity, why are you using a module in the first place? For an object that you only want one instance of, check out the singleton design pattern. It is much more elegant than global variables or global functions (like what this module is doing essentially).
Check out singleton pattern on this site or on Google.
Another good option that most enterprise applications use is storing database connection information in a config file. .NET comes with app.config which can be used through the System.Configuration classes. You can also wrap your own with an XmlReader.
Andrew Peters, MCSD
Fabrefactum Software
|
|
|
|
|
You have, some example for that ???
|
|
|
|
|
this seems easy but I just got stuck
I just wanna display an error message if the textBox is left empty, and display another error Message if the entry is not an integer.
I used the if statement (if var=="")
MessageBox.Show(" you must enter anumber")
but it gives me an error message everytime I try to compile ...Help please
aPerfectTool
|
|
|
|
|
int nFoo = 0;
string strFoo = myTextBox.Text.Trim();
if (strFoo.Equals (String.Empty)) {
<code>
...
} else {
try {
nFoo = int.Parse (strFoo);
} catch (Exception) {
<code>
...
}
}
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hey ravi thanks for your quick response,
I'm still having the same problem, when i run the code, it always do the try and catch first with leaves me with only one error message<invalid data="" entered="">
if I leave the textBox empty the program just bomb on me !!!!???
aPerfectTool
|
|
|
|
|
aPerfectCircle wrote: the program just bomb on me
I'm not sure I understand. Please post your button's click handler code.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hey Ravi I just got it working thanks for your help
aPerfectTool
|
|
|
|
|
|
Hi,
I need to start a process and wait for it. I have tired several things, but it keeps locking the originating program up while the other process is running and wont even refresh. I would like it to behave like normal but just wait and not allow the user to do anything...pause but still refresh when you drag a window over it. The code for the most part is right out of the MSDN.
This is the code I have right now:
const int ERROR_FILE_NOT_FOUND =2;
const int ERROR_ACCESS_DENIED = 5;
Process myProcess = new Process();
try
{
myProcess.StartInfo.FileName = Application.StartupPath + "\\" + ProgramName;
myProcess.StartInfo.UseShellExecute = true;
myProcess.Start();
myProcess.WaitForExit();
}
catch (Win32Exception e)
{
if(e.NativeErrorCode == ERROR_FILE_NOT_FOUND)
{
MessageBox.Show("Install file can not be located.");
}
else if (e.NativeErrorCode == ERROR_ACCESS_DENIED)
{
MessageBox.Show(ee.Message +
". You do not have permission to run this file.");
}
}
Sean
|
|
|
|
|
I expect the call to WaitForExit() causes the caller to block?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Yes it does, but I need it to. I need the main program to wait to the called program exits before it can go on. But the things I have tried break the main program's ability to refresh, resize, minimize, maximize, etc... I don't want it to look like it is not responding I just want it to wait patiently and behave.
Sean
|
|
|
|
|
WaitForExit is a blocking call, so if you call this method on the UI thread, it'll stop you from repainting the form. Sooo, you don't call it.
What you can do is set the new Process' EnableRaisingEvents property to True. Now, when the Process exits, it'll fire a Exited event which your app can subscribe to.
But, before(!) you start the process, disable all the user controls you don't want the user to play with while this process is running. In your Exited event handler, you can re-enable all the controls.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 18:13 Friday 6th January, 2006
|
|
|
|
|
Ah, OK thanks. That makes sense. Is there a way to disable all the controls? Well except for the main windows things mentioned above, resize, minimize, etc... I am sure there is, never mind, I will go look it up. Thanks for getting me that far though.
Sean
|
|
|
|
|
foreach (Control c in this.Controls) {
c.Enabled = false;
} /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi.
I write a program that have a database(Access) and is using crystal report.
How can I make a setup for it?
My question is more about Access databaes and crystal report.
(C#,VS2003)
Best wishes
|
|
|
|
|
|
Hi. I am a new beginner in C#. If a C# project is started with a normal Windows application template rather than a SmartDevices template, is there anyway to change it afterwards?
Thanks, Pedro
|
|
|
|
|
Not easily. The best bet would be to create a SmartDevices project and copy over the files that you need
Jared Parsons
jaredp@beanseed.org
http://jaredparsons.blogspot.com/[^]
|
|
|
|