|
on pressing button in Form 1, it opens FORM2 and hide itself. But the problem is the FORM2 pops up in different location of the screen..and when i exit that, FORM1 pops up but thats in different location.Whereas i want this to be at the same location. Just looked over properties to set the location but even when i set the same location on both the forms, it results in poping up at different place.
What can be the reason for this ? I am sure its one of the easiest thing to do but sometime that gives you heading too...
Thanks
|
|
|
|
|
Hi,
setting Form.Location only works the way you want if you first set
Form.StartPosition=FormStartPosition.Manual;
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi!
I have three tables created in SQL Server:
Tabe for Ingredients:
Ingredients
CodIng (INT) Primary Key
Descrip
Cost
Table for Recipes:
Recipes
CodRec (INT) Primary Key
Descrip
Table to specify the Ingredients that a recipe has:
RecipesIngredients
CodRec (INT)
CodIng (INT)
Quantity
I want to show RecipesIngredients for a given CodRec in a datagridview and modify it (for example add, remove or modify ingredients in a recipe) but I also want to show the description for them.
I mean I want to show in the datagridview FOR A GIVEN RECIPE (not for every recipe) these columns:
CodRec, Descrip (Recipe), CodIng, Descrip (Ingredient), Quantity
Which is the best way to do this?
Thank you!
|
|
|
|
|
hi
write a SQL query using joins in SQLdataAdapter.Using this adapter fill a datatable and bind this table to datagridview. The query will be like,
"select RI.CodRec,REC.Descrip,RI.CodIng,ING.Descrip,RI.Quantity from RI as RecipesIngredients,REC as Receipe,ING as Ingredient where RI.CodRec='receipe code' AND RI.CodIng=ING.CodIng AND ..."
This query may not give the result u want,but u have to use joins like this to get the desired result.
|
|
|
|
|
Ok, I knew how to show it.
The probem is that I will not be able to modify, insert or update the ingredients for a given receipe with that table binded to my datagridview...
Or is it possible?
|
|
|
|
|
Hi!
I am trying to write and application which will capture moving object from video camera and then move the cursor.
I will appriciate any help and guidence..
Thank you!
=Mani=
|
|
|
|
|
There's a commercial library called TVideoGrabber that offers this. If you need to write it yourself, you need to write a DX filter so you can examine your frames and look for movement.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey folks, I think this is my first time asking a question here, so please go easy on me
I have an application wherein I render a transparent bitmap (to be specific -- a chart with a transparent background).... When I do, I then try to copy it to the clipboard using:
<br />
bmp.Save(filename);
Clipboard.SetImage(bmp);
Now if I open Excel, and click Paste (from the clipboard), I end up with a copy of my chart with this lovely blue background wherever the transparency color was.
If I, instead, use Excel's Insert->Image->From File, the chart's transparency is preserved... (same bitmap as above, just one is saved to file system, the other is copied via clipboard)
What gives? Am I copying the bitmap incorrectly, or is there something else I need to do to make copy and paste of transparent bitmaps a reality?
(I have searched high and low, and nothing seems to answer this question... I have tried all kinds of things to resolve this on my own, even using MakeTransparent() (which has no effect, since the bitmap was already transparent to begin with (as evidenced by the Flags value on the bitmap being "2" which is hasTransparency)... I have tried converting the image, using color maps, using SetClipboardDataObject, converting to an HBITMAP object or whatever.... all kinds of things, nothing seems to avert this issue....)
Thanks in Advance!
=============================
I'm a developer, he's a developer, she's a developer, Wouldn'tcha like to be a developer too?
|
|
|
|
|
Transparency is only supported by some file formats, such as PNG. The raw BITMAP format, which is what Windows uses internally, does not support transparency. The Bitmap class does allow setting a color that is transparent, I *think* ( it may be that the support only exists at the point of drawing the image ), but ultimately I suspect what you're finding is that the clipboard contains a raw image, not an image in, say, PNG format. That's if Excel can work it out. More likely, an image in the clipboard is a plain vanilla bitmap, and the image when loaded by Excel, is loaded as a PNG or other format with transparency support, and thus it's respected by Excel, because it's still there.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm writing an windows service, which accept connections via a TCP/IP socket. I want to verify the connectin users against windows accounts on the local machine.
Do anyone know if there are somthing in .net to do this??
I have looked in System.Security.Principal, but all I could find was "current loged on user", which is not much of help. I would like to have somthing where I pass a username and password and get "accept / denied" or perhaps a usergroup or simular back.
Ola Ericsson
|
|
|
|
|
I need help coding the following pseudo code into C#.
The 3 algorithms are search methods for a program which can look through a set of data to find the subsequence of values which add
up to the highest total value.
So for example with the data set.
10 -6 12 -17 9 8 -2
the algorithm(s) show that the "best" value was 17 from array index 4 to array index 5 if you go through it. (9 + 8)
10 - 6 = 4
10 - 6 + 12 = 16
10 - 6 + 12 - 17 = -1
10 - 6 + 12 - 17 + 9 = 8
10 - 6 + 12 - 17 + 9 + 8 = 16
10 - 6 + 12 - 17 + 9 + 8 - 2 = 14
-6 + 12 = 6
-6 +12 -17 = -11
-6 +12 -17 + 9 = -2
etc
For every possible start position // every array index
For every possible end position // rest of array from current start
{
Set subtotal to 0
For every value in subseq // between current start and end
Add profit value to subtotal
Update subseq info when subtotal exceeds current best total
}
For every possible start position...
Set subtotal to 0
For every possible end position...
{
Add end position’s profit value to subtotal
Update subseq if subtotal exceeds current best total
}
Set start position to 0, subtotal to 0
For every profit value... // index from 0 to end of array as end position
{
Add value to subtotal
Keep subseq info (start, end, total) if total exceeds current best
If total is less than 0,
set start position to next index and set total to 0
}
I need help creating C# versions of these methods which compile and run.
Thanks
|
|
|
|
|
How far have you got in trying to do your homework ? WE're not going to do it for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
srmanuel wrote: I need help creating C# versions of these methods which compile and run.
What is it that you need help with, specifically?
The assignment is pretty straight forward. The work to figure out how the code should work is already done, you just have to write the code itself.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hy everyone!
does anyone of you know how to insert checkboxes into datagrids?
if i search the net for hints there are just solutions for VB but none for C#. I guess if it is possible to do it in VB then it should also be possible in C#. When I do it in a similar way the only result is tons of error/compile messages because I can't bind them etc.
Does anyone know if it is possible in C#?
thanks.
Stephan.
|
|
|
|
|
simple solution
use datagridview
better and more powerfull tool
if not i think it goes like this:
DataGridColumnStyle Collection and add a DataGridBoolColumn
Have Fun
Never forget it
|
|
|
|
|
hy everyone!
i do have a program which allows me to syncronize with ldap etc. to get the user data from active directory to this program. then i do have a service, which accesses this program using the login info (username and password).
so what i want to do is to install it on different computers or to call it from different computers and use the credentials of the current user logged in to get access to my program.
to visualize it's something like that:
PC => SERVICE => TOOL/PROGRAM
the logindata in the tool will be the same as they are on the pc. but i have to send them to the tool via the service.
does anyone know how to retriev these infos to allow me sending them via my service to the program to log in?
thanks.
Stephan.
|
|
|
|
|
Well, you can't retrieve password from current user... As far as i know, there is no way you can do it without additional password recovery programs...
|
|
|
|
|
|
yup, i guess this is the easiest way, but won't work when sending it with the request
well the tool on the other side provides a native login as well, meaning you are able to log into it using you domain info. or you are able to import it into it. so i wonder which way this tool gets the info out of the active directory. because the same thing is what i need
|
|
|
|
|
Well, wanna know how to insert text in other programs or click the button in other application etc... And is it possible?
|
|
|
|
|
you mean you do have two programs and you want to send strings from one program to the other? or to click a button from application 1 in application 2?
is it possible for you to include one appliction (or the sources respectively) into the other? if so, then you are able to access the class and if you used public etc. then you are also able to access this function from application 2 in application 1.
if you do not want to include it, well then i guess you have to do it by writing it to a tempfile via a stream and parse it by the other program once again.
well, maybe you could describe your idea/problem in a more detailed way, then it's easier to answer your question.
Stephan.
|
|
|
|
|
If you have the source for both, you can write ways for the to communicate. If not, it's theoretically possible, but never going to be easy, or reliable. You would basially look for the handles to textboxes and buttons and send them WM_ messages.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The purpose of the code I am trying to create is to read data from a database. What I am trying to do is (when I run the exe file (on my desktop) of my code) to access my access database (mdb) which is burnt on a CD.
In order to do that I have to know the path of the mdb file.
I dont want to hard code and say D:\test\my.mdb because the driver name can be anything (for instance at my home computer the CD drive is called E:)
So i have 2 questions:
1- What is the code for retreiving the driver name (D or E or etc)?
2- If the user has multiple drivers, is there a way to find out which one s/he put the CD and retreive that driver's name?
Thank you in advance!
|
|
|
|
|
Hi,
here is how:
- get all the drive letters in use from DriveInfo.GetDrives
- for each of them inspect DriveInfo.DriveType
- when equal to DriveType.DCRom, go look for your .mdb file
If your system has multiple CD/DVD drives, and more than one contain a medium with your file,
it is up to you to choose!
FYI: the above would also find virtual CD/DVD drives, like the .iso files opened by
"deamon tools".
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks for the reply Luc,
Do I have to add any libraries under the "using" section, in order to make DriveInfo recognizable?
|
|
|
|