|
Once an hour is rather infrequent; a Windows Scheduled Task might suffice.
|
|
|
|
|
You don't need to be a programmer to do this though - it's a matter of job security.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
After performing operations on mutiple images at the same time(batch image processing) I want to save the images in the same format as the original one.How can I achieve this Can someone pls help.
|
|
|
|
|
Have you considered Image.Save[^]?
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Hi,
Has anyone experienced issues using functions such as SetWindowPos() when moving maximized remote desktop windows over extended desktops.
When I maximize the remote desktop to one of my screens and move the remote desktop to another screen using the c# MoveWindow() function the Remote Desktop yellow title tool bar gets left behind.
What I want to do is take the remote desktop out of full screen mode and run it in a restored state on another screen.
Is there an alternative as SetWindowPos only seems to handle regular windows.
It also seems to not handle multiple screens very well as when I use the functionality to maximize a screen the edges take up 4 pixel columns from point -4 to 0 and from point 1024 - 1028, where I have to manually adjust.
Hopefully I’m just using the wrong functions to position windows.
Functions uses: GetWindowRect, SetWindowPos, MoveWindow, GetWindowPlacement.
As per the following using parameters:
SW_HIDE = 0;
SW_SHOWNORMAL = 1;
SW_SHOWMINIMIZED = 2;
SW_SHOWMAXIMIZED = 3;
SW_SHOWNOACTIVATE = 4;
SW_RESTORE = 9;
SW_SHOWDEFAULT = 10;
For Min, Max and Normal:
WINDOWPLACEMENT param = new DisplayManager.WINDOWPLACEMENT();
GetWindowPlacement(referenceHandle, ref param);
param.showCmd = SW_SHOWMINIMIZED;
SetWindowPlacement(referenceHandle, ref param);
To bring a window to top:
SetWindowPos(Handle, HWND_TOPMOST, xPos, yPos, width, height, TOPMOST_FLAGS);
To move a window to a specific location:
MoveWindow((IntPtr)positionHandle, (offset + xPos), yPos, width, height, true);
Getting the position of a window:
GetWindowRect((IntPtr)positionHandle, ref activeAreaApp);
Patrick.
|
|
|
|
|
It appears as if the remote desktop title bar only displays on the primary monitor.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
In my situation the remote desktop title bar is sticking to the screen which it was maximised on. I'm driving four screens including the primary where I have remote desktops on each screen. When I minimise each remote desktop each screen keeps the associated toolbar at the top of the screen.
It looks like a maximised remote desktop is a different type of window mode when compared with an application like word. Maybe it's running a type of console / kiosk mode window which behaves differently.
|
|
|
|
|
namespace example
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void addEmployeeNumberToolStripMenuItem_Click(object sender, EventArgs e)
{
//this.comboBox1.Items.Add(textBox1.Text);
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
Hello, I have a form with one combobox on it- and menu item: addEmployeeNumber.
is there a way to click employeeNumber toolstrip menu and have a text box display and then once filled with data -it can be added to combobox- or another way- my code this.comboBox1. items. add ( textbox1.text); is not working the right way.
|
|
|
|
|
Why don't you show a new form to capture the data you require and raise an event with custom args to send the data back to the host form where you can update the combo?
I gave an example here[^] the other day.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
I have written a program that uses the ID field in an access database. If the user removes an item the autonumber still increments by one. That is fine but my question is this.
How does one retrieve the value of the next autonumber when the add new item button is pressed on the bindingnavigation bar?
I originally was doing
int rowcount = this.bookdbDataSet.Tables[0].Rows.Count +1;
this works but it shows me the true value of records in the table. I don't want that I want to know what the next autonumber ID would be.
Example: I have filtered using a search for say cat
I get 2 records back the navigation bar says 1 of 2. And that listings Item ID: 1. I then discover that I wish to add another record so I hit the add button. I would to autofile the Item ID box with the next autonumber in the IDcolumn of the database.
I hope I'm not confusing anyone. Your help is greatly appreciated.
|
|
|
|
|
Hi,
this is a database question, not a C# question.
you should tell your database to generate unique numbers automatically, and then not worry about them yourself. With your code in charge things would go wrong when multiple requests come in around the same time.
BTW: Most databases offer a way to get the primary key of the row that was affected by the insert or update operation once it has been executed.
|
|
|
|
|
the database does generate numbers automatically. but my question is simply how to get the next value in which it wishes to assign. if the value was 4 or 900 i don't care just wanna know how to get that value
|
|
|
|
|
There's no reliable way to tell. If the last record you created gets deleted, how are you going to know that??
Normally, you either create a blank, or partially filled, or even completely filled, record in the database, except for the autogenerated number, get the ID after the data is inserted and use that for the remaining operations, if any.
|
|
|
|
|
well whats the correct syntax in c# to do something like this ?
int itemvalue = this.bookdbDataSet.Tables[0].Rows(bookdbDataSet.Tables[0].Rows.Count - 1)("ID");
that should bet the id value of the last item in the dataset which is what i'm seeking.
thanks for your help by the way...
|
|
|
|
|
there seems to be no safe way in MS Access, Google around and you will find things like this one[^].
|
|
|
|
|
I figured it out thanks for the help guys.
Here for anyone curious about how to do something like this...
this.locationTextBox.Text = this.bookdbDataSet.Tables[0].Rows[bookdbDataSet.Tables[0].Rows.Count - 1]["ID"].ToString();
|
|
|
|
|
Yeah, that gets you the last "currently used" row. It will NOT give you the ID of the next record that's going to get created. Because Access doesn't support true stored procedures, there's no way to reliably get the ID of the records that was just created.
|
|
|
|
|
Okay, thanks again to you and everyone else. Let me explain what I'm trying to accomplish and whatever the best approach to this is where I'll direct my attention. I seen someone mention the GUID's which sounds great however I don't think it will work with how I intend to use the number.
See my mother was using pure access to enter her books manually for school. She has well over 800+ books for Kindergarten. Anyway, in order to find her books she takes and assigns them a number starting with 1, then 2 and 3 and so on. Lets say that book 3 gets lost. It is no big deal per say because if she had 800 books and decided to replace book 3 it would get a new number of 801. Basically what I'm saying is it doesn't have to be the TRUE number or records it just has to be a unique number but in sequence...
With the above being said it is still advised to use GUID's or is there a way to take and look at a field in the database. say LOCATIONNUMBER and somehow get the greatest value in there. Once i have the greatest value simply add 1 to it and that would be my next suggested book number?
Sorry to be a pest and hopefully I'm not seen as one just trying to figure this out so we can start filing the books she lost in the flood again.
thanks for your help,
tony
|
|
|
|
|
Easy. Retire the lost book with a flagged field or something, maybe even a description as to why it was retired. Enter the information into the database, let the database assign the book number, you can then retrieve the ID number of the last record inserted using this[^]. Then you can show her what the number assigned was.
|
|
|
|
|
Thanks that is exactly what I wish to do.
I tried adding this on the additem button click but i keep getting can not interrupt token @ at position 8
int idnumber =0;
idnumber = Convert.ToInt32(bookdbDataSet.BookList.Select("Select @@IDENTITY"));
idnumber += 1;
|
|
|
|
|
What does your connection string look like? This little trick only works on Jet 4.0 databases.
|
|
|
|
|
I actually got it how I want it now. Thanks again for putting up with me.
What I ended up doing was taking your advice of the whole retire the book show her the last number generated idea. That is essentially what she wanted so I went with that instead of making it more complex than it needed to be.
What I ended up doing was adding a checkbox for the retire and also adding that column into the database. Then based on your advice I took and generated a message box telling her what the last item number was when she clicks save. This works great cause if she removes the book (I removed this feature because I feel it shouldn't be removed but simply either updated or retired), but if she took and removed it it would still show her the correct next number. In order to do that I simply called on the previous code i posted about getting the row count -1's ID value and then adding 1 to it.
thanks again.
|
|
|
|
|
Auto numbers s*ck; don't use them. Use GUIDs instead; you can generate them in the client code and then pass them to the database.
|
|
|
|
|
Hi ive just started using emguCV the .net implement of openCV
Im very new to c# and coding in general so i decided to do some Video analytics instead of the usual "Hello World" just to break me in.
I have a picture box on my form which shows the camera output
im just after a bit of advice on this bit of code in my project. I cant understand why the code below works and refresh the image fine, yet the code below the code below doesnt, even though in my head it should work fine
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
Capture capture = new Capture();
Application.Idle += new EventHandler(delegate(object sender1, EventArgs ef)<br />
{
pictureBox1.Image = capture.QueryFrame().ToBitmap();
});<br />
<br />
<br />
}<br />
and my revised version of it doesnt work see below
private void Form1_Load(object sender, EventArgs e)
{
Capture capture = new Capture();
while (true)
{
pictureBox1.Image = capture.QueryFrame().ToBitmap();
}
}
the first bit of code is pretty much straight off a tut and it works fine but I dont understand what its doing when it does this
Application.Idle += new EventHandler(delegate(object sender1, EventArgs ef)
but if i dont put
pictureBox1.Image = capture.QueryFrame().ToBitmap() in a loop it works but obviosly its just a static image. so i thought if I loop it it would just keep refreshing as fast as it can get a frame from the capture.
If anyonce can help me or even understand what im on about it would be much apreciated.
|
|
|
|