|
I created a custom control derived from Control but it doesn't seem to have the default focus behaviour (i.e. mouse click inside the control gives it focus). If I add a handler for OnGotFocus it never gets called.
How can I make it respond to focus events?
|
|
|
|
|
Hi guys, i'm sorry for this post since it's clear i still haven't grasped the big picture of how this works yet, so please forgive my ignorance...i'm still very new to c#.
Can someone explain to me how i can use this code to connect to a database and display records? i'm not worried about the db connectivity, since i have that part working, but i am having a problem understanding how to use this code in sections...
for instance, i want to open a dbconnection, then run a sql query based on user input, then close the connection. The only way i know how to do this is to create ONE method that opens the database, executes the query, then closes it again. I'd rather do it in sections like what i have, but maybe that it isn't the best programming...any input on how i can structure this would be helpful.
thanks.
namespace CreateConnection<br />
{<br />
public class dbcon<br />
{<br />
String _dbString;<br />
<br />
public dbcon(String _dbString)<br />
{<br />
OdbcConnection dbConnect = new OdbcConnection(_dbString);<br />
}<br />
<br />
public void dbopen()<br />
{<br />
dbConnect.Open();<br />
}<br />
<br />
public void dbquery(String _dbquery)<br />
{<br />
String output = "";<br />
<br />
OdbcCommand cmd = new OdbcCommand("",dbConnect);<br />
cmd.CommandText = _dbquery;<br />
OdbcDataReader dr = cmd.ExecuteReader();<br />
<br />
while(dr.Read())<br />
{<br />
for(int i=0;i<dr.FieldCount;i++)<br />
{<br />
output = output + dr.GetValue(i) + ",";<br />
}<br />
output = output + "\r";<br />
}<br />
<br />
dr.Close();<br />
}<br />
<br />
public void dbclose()<br />
{<br />
dbConnect.Close();<br />
}<br />
}<br />
}
.gonad.
|
|
|
|
|
...thanks, but i figured it out myself.
.gonad.
|
|
|
|
|
What's the difference between LocationChanged and Move events for Controls?
The documentation isn't very clear, but it reads as if LocationChanged is a superset of Move, but it seems that in practice both are called at the same time, except that Move events are fired just before LocationChanged events, perhaps.
It looks like I'll be using LocationChanged, to be safe, but if there are any suggestions otherwise, I'll take 'em!
Thanks,
Arun
|
|
|
|
|
Hi,
I'm really not sure where and how to strt .net & C#
ANY GOOD SITES...???
Rgds
Srinivas
|
|
|
|
|
um...you could try this.
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
|
This[^] is better .
i'm only pointer to myself
|
|
|
|
|
iv been trying to find some reasonable info on how to Bind DataBase Field to Column BackColor Property.
this only binds the data grids main properties back color but i need the individual Column to be bound.
dataGrid1.DataBindings.Add("BackColor",DataSource,"DataSource.Field");
Does what is below have anything that can lead me to it?????
// Use a PropertyDescriptor to create a formatted column.
PropertyDescriptorCollection myPropertyDescriptorCollection = BindingContext
[myDataSet, "Table.Field"].GetItemProperties();
// Create a formatted column using a PropertyDescriptor.
DataGridColumnStyle csField =
new DataGridTextBoxColumn(myPropertyDescriptorCollection["Property"], "c", true);
csField.MappingName = "Property";
|
|
|
|
|
I want to uses MsHFlexgrid in C#, but it don't.
How I uses it in C#?
Please help me.
Thanks.
|
|
|
|
|
Hello Hoang Dung,
I think MSHFlexgrid only works with VB but not 100% positive. Try the following Link and you'll see MSHFlexgrid is listed under VB 6.0.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mshflx98/html/vbidxMSFlexGridControlConstants.asp
Khang Nguyen
|
|
|
|
|
DataGrid in C# have all the properties of MSHFlexgrid. so why to go for that????
sorry for my bad English.
|
|
|
|
|
you can use a flexi grid in C# , just add it to the toolbox :
VB:
<font color="blue">Private</font> <font color="#0000FF">void</font> button6_Click(<font color="blue">Object</font> sender, System.EventArgs e)
{
<font color="blue">For</font> (<font color="#0000FF">int</font> i=0;i<20;i++)
{
axMSFlexGrid1.AddItem("item\t" + i,0);
}
}
hope that helps.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
How I can show a html page in Windows Form and scale the whole document to a smaller size. It's like when you browse a hard disk and click on html page then you can see a small preview of this page on the bottom-left in Explorer. So the quaestion is - how I can make this 'preview' window in C# ?
|
|
|
|
|
There probably is a better way, but here's one that almost has to work.
Open a hidden web browser, and load the desired page. Capture the image from that browser's screen, scale it down, and display it where you want it.
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
1) How I can capture image in C# ?
2) How I can capture image of HIDDEN browser ?
|
|
|
|
|
Hello again gurus,
When you add a INHERITED Form to your project, you get to a form named "Inheritance Picker". This form is very small in size and the items in the list are so tiny. It's a pain to figure out what to select on my monitor.
If gurus have any ideas how to improve it, I appreciate your tips so much.
Thanks again and have a great day
Khang Nguyen
|
|
|
|
|
Hello Gurus,
I could not find where to turn on the Line Number option in C# code editor like we can do in TextPad or JCreator.
Thanks
Khang Nguyen
|
|
|
|
|
Should be under:
Tools->Options->Text Editor->All Languages->General
I'm using VS.NET 2002 not sure if they moved it 2003
- monrobot13
|
|
|
|
|
You're right on, monrobot13! It's so helpful...
Thanks Monrobot13
Khang Nguyen
|
|
|
|
|
Hi!
I am writing a kind of spy tool in c#. Now I need to find out what
files are currently used (opened) by a certain process (knowing the
processid).
I know that there is this undocumented windows function
NTQuerySystemInformation, but I hope that there is another solution.
I tried NTQuerySystemInformation, but as I am not an interop-expert
I could not make it work ...
Is there anyone that solved that problem once, or has a code example
on how to invoke NTQuerySystemInformation in c#?
|
|
|
|
|
|
How to go about accessing the shared memory in C#.. fist of all how ot create one in C#..! Any pointers or reference is highly appreciated.
Visit me @ http://www2.domaindlx.com/earavi/
When you know something.. its meant to share with others for otherwise that knowledge has no worth
|
|
|
|
|
The below page contains a wrapper for shared memory
http://staff.develop.com/richardb/
- Kannan
|
|
|
|
|
Thanks it did provide a basic start that i was expecting!..
-Aravi
<hr>
Visit me:
http:
When you know something.. its meant to share with others :-) for otherwise that knowledge has no worth:-)
mail me:
aravinthan@rediffmail.com
<hr>
|
|
|
|
|