|
I need combo1 tied to tableA 'customers'
table is ID, Name
I need combo2 tied to tableB 'Stores"
table is CustomerID, Store Number
what is the best way to tie these together?
|
|
|
|
|
|
but I'm binding to table with ID, Name with the displaymember on name and value on id. how would I databing to the ID?
|
|
|
|
|
|
When the windows is shown, it will take focus.
What I did was call native fun GetActiveWindow()
do a show and then call SetActiveWindow(activeWindow)
|
|
|
|
|
You can use AK's suggestion, or you can use the ShowWindow() API with the SW_SHOWNOACTIVATE flag.
[DllImport("user32.dll")]
protected static extern bool ShowWindow(IntPtr hWnd,int nCmdShow);
protected const int SW_SHOWNOACTIVATE = 4;
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I am sure the answer to this question is simple...but I sure haven't found an answer on my own.
In my spare time, just to relax, I've been coding the Conway Life algorithm. I am currently doing a fairly good, and fast display of the Automaton generations growth. However I want to incorporate scaling as well as a much larger viewing world than I have today.
The problem I have is getting a graphic control implemented that supports scroll bars. I am currently using a PictureBox control which supports both the drawing of the ellipses as well as recognizing the mouse_down event.
Do I have to blend a picture box with another control to get it to present scroll bars? Or is their another graphic control I can deploy? The basic idea here is I have a fixed windowed area, with buttons in a GroupBox to control the generation machine (turn on/off/load pattern/etc) and the graphic window to show the generations.
At the moment the graphics are tightly bound to the fixed array I'm using but I want to alter my algorithm to use blocks in a list with a hashtable for lookup similar to how Allen Hensel is doing it in Java. This will support up to 4 million generations for a 'mover' which requires a movable graphic window.
Thanks to anyone that can answer this!
MJ
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
|
Everybody here has probably used :
MessageBox.Show("Hello");
The problem I am working on is that when you create a message box in this way it puts an 'OK' button and this button has focus so if you press return it closes the box.
Is there a way to display a messagebox where the 'OK' button doesnt have focus, therefore forcing the user to click the button?
|
|
|
|
|
doesnt that violate the user experience rules?
but just inherit the thing and impose your own rules.
|
|
|
|
|
Yes it does, but for my sins (I must have been really evil in a past life) the users I code for ask for the strangest things.
I use message box to display certain bits of information and the users are simply pressing return without reading the message as 99% of the time they 'know' what it will say, unfortunatly for me and them 1% of the time the message is different and if they dont acknowledge what it tells them it spams everything they are working on.
So in an attempt to rein in my users, I want to force them to click - its about as much as I can do, short of writing an ElectrocuteUser class (which would be nice )
In the end I did what you suggested and used inheritence, ho hum, tomorrow is just another weird request away.
|
|
|
|
|
well cool. What I did before .net was alive was made my own MessageBox form and used enums to imitate it.
you might try that cause then you can get a custom type message box
|
|
|
|
|
Ans actually you might even think of using error providers and more validation to make thier life more hell and make yours easier.
|
|
|
|
|
Hi!
How to properly add attachment to new Outlook.MailItem ?
I've made it that way:
this.mail.Attachments.Add(FileName,1, null, fname);
It looks correct, I can also save this attachment by calling
this.mail.Attachments.Item[i].SaveAsFile(FileName);
but the problem is that attachments are not sent with the message (or maybe they are included, but not "visible" in outlook).
Any ideas?
thanx
h.
|
|
|
|
|
We are building a large Win32/web n-tiered system and I'm looking for some comments of the various security models available.
Some of our components will be webservices and some will be using .NET remoting (on TCP) so we can't use the normal pass-through security.
We intend deploying within an Active Directory environment.
All our rights management information will be stored in A.D. and our SQL server.
Our initial idea was to pass the username as the first parameter of method calls and have this used by our security.dll component. Obviously this can be easily spoofed, so we're currently looking for other options.
How are you guys currently doing this?
Cheers,
Simon
"Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
animation mechanics in SVG (my first abstract photo)
|
|
|
|
|
Hello friends
I have some problem dynamically showing HTML pages that have tags. Say I have a string like this :
strHTML = "<html><body><h1> Test </h1></body></html>"
I can easily load this string in my Microsoft Web Browser control as below :
IHTMLDocument2 doc = (IHTMLDocument2 )MyBrowser.Document;
doc .body.InnerHTML = strHTML ;
But, what if I would have some tags in my document ?
strHTML = "<html><body><h1> Test </h1><img src="Images/someImage.jpg"></body></html>"
In this case, I have created Images folder in the same folder as my *.exe file exists. But the image is not shown as I expect! note that the path of src attribute is relative, so I don't understand really what's the problem!
please help!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hi,
Does anyone have any ideas how i can get at the glyph outline of truetype font characters? I know in c++ i can use structures like glyphmetrics etc but am trying to find a way in c#, if its possible??? Any help would be good
Adam
|
|
|
|
|
|
I have an application that takes a load of data and pumps it into a Datagrid, the problem I have is that I want to be able to retrieve all the values for the currently selected row in the grid.
Is there a way of using the current row index to retrieve all values into a DataRow (I also need the column header names aswell)?
At the moment I am doing this a god awful and rather restrictive way, by using :
int selectedrow = myGrid.CurrentRowIndex
string val0 = myGrid[selectedrow, 0].ToString();
string val1 = myGrid[selectedrow, 1].ToString();
string val2 = myGrid[selectedrow, 2].ToString();
string val3 = myGrid[selectedrow, 3].ToString();
.....
I am open to any other suggestions, as I dont have to use a DataRow - so over to you guys.
Thanks
|
|
|
|
|
Well I have found what seems to be a solution to my problem. The following code will get the currently selected datagrid row into a datarow :
CurrencyManager cm = (CurrencyManager)dgOrgData.BindingContext[dgOrgData.DataSource];
DataRowView drv = (DataRowView)cm.Current;
DataRow myRow = drv.Row;
Now the plot thickens a little, I use this code to get the datarow values for a datagrid row when a user right right clicks on the datagrid (code is in a contextmenu event) - what I would also like to get is the cell value that the user right clicked on?
|
|
|
|
|
Hi guys !
I've a WinForm with 2 ListView control and I've something special to do with the 2nd ListView. If user changes something (like ColumnHeader size) on ListView 1 then this change will be applied on ListView 2 too.
My first approach was to override WndProc of ListView 1 and foward all messages to ListView 2 (via Win32 api function SendMessage()) but it was unsuccessful.
Any idea ?
--
Regards,
Julian.
|
|
|
|
|
why not just add a delegate for the event then execute a command on the second
|
|
|
|
|
Input from where exactly? From a file, from a stream, from a console application, from a form?
Without context, I can't help you. Mind you, even with context, the question may have no answer either . For example, if you're using a TextReader, you can't get at the "raw" character; it'll have been translated into a standard UNICODE character.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
DeanAgan wrote:
Its actually read from a textbox. Translation into a standard unicode? How do u do that? The code is suppose to block input in the textbox that exceeds 32 characters. But if I would input in Chinese characters, which has a double byte character set, then even if only 32 characters are inputted, problems would still arise coz its actually 64 characters in single byte character set. Im looking for what class to use, though I can solve it without using a class and just by looping through it.
When you are talking about the MaxLength property of the TextBox , that is refering to the actual number of character entries that are allowed, not the number of bytes. Under .NET, the TextBox 's Text property returns a String data type which is of Unicode encoding where all characters are two bytes long.
-Nick Parker
|
|
|
|
|
I heard that C# and other .Net app can be compiled as then native app,don't need to use JIT.
How?
Thank you!
Let's roll!
|
|
|
|