|
I don't see how that would even be possible. To do it, in addition to knowing the size and type of a monitor to get the approximate screen size (ie 17" crt is about 16" usable), you'd need to know the exact position they adjusted the hieght and width controls to. Beyond that, if you did do this you'd create something that was completely unusable for anyone who, for bragging rights or due to poor vision, is using a projection screen as a primary display.
|
|
|
|
|
I don't see why not.
Infact, I've found how to do it:
g.PageUnit = GraphicsUnit.Millimeter;<br />
g.DrawRectangle(Pens.Black, 50, 50, 50, 50);
does exactly what I need: without care of dpi draws in inches/millimeters/whatever.
|
|
|
|
|
I am using Microsoft's Message Queue and want to get the ID of the Message I just placed in the Q. Reading a few of the examples I have found it says you can do a simple:
mq.Send(msg, Ticket);
string id = mq.Id.ToString();
All this does is return me a Guid with all zero's in it.
I open up Message Q and see my package there. The 'Label' on the Package is all zero's, however, the ID is an actual Guid.
I have tried 'Label' instead of 'Id' and still nothing.
I really need to get that ID of that package I just inserted into Q for processing.
Any help would be appreciated.
Steve Welborn
Software Architect
|
|
|
|
|
|
DOH!
Your right, worked great. Thanks leppie!
Steve Welborn
Software Architect
|
|
|
|
|
I made this with xacc ide...
apparently it didn't make it to the clip board. It was really cooL!
/\ |_ E X E GG
|
|
|
|
|
Hello,
I have a string to display in my text box:
this.textBoxAssumedHC.Text = (Convert.ToDecimal(myStr)).ToString("c0");
But on leave event I want to convert it back to decimal value, and because there is a dollar sign in front (provided by "c0") it gives me an error.
Any ideas, because I don't want to use the split function.
Thank you
|
|
|
|
|
If you just need to drop the '$', why don't you just use substring to get a substring containing all the chars except the '$', and then conver that?
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
We are creating a windows desktop application and are wondering if there is a disadvantage performance-wise in using User Controls versus embedding the code into the main form.
Thank you for any feedback you can give,
Anne
|
|
|
|
|
no performance problem especially if you dont have many controls in many DLLs
in another side using user controls have advantage like
Usability and maintainability
MCAD
|
|
|
|
|
I have a nice table that I create and show in a datagrid. The data loads perfectly, and then displays nicely. But I need to do some things with it. For starters, I want to add another column that is for display only. So I've tried to add the column "Date" as shown, but it never shows up in the datagrid.
I also want to be able to set the Date column, which I thought would entail cycling through the rows. However when I try to cycle through the rows (in the foreach statement) nothing happens. The MessageBox.Show never pops up.
Any idea why my new column won't show up and why I can't cycle through the rows of my table?
If there's an easier way to just add a column and dynamically change the entries for each row, let me know. And if there's a way to keep data in the data set/data table and NOT show it in the datagrid, I'd like to know that too (I don't want my primary and foreign keys showing up at all but i need to keep track of them).
Thanks!
strClaimsSQL = this.GetClaimsSQL();
da = new OleDbDataAdapter(strClaimsSQL, strConn);
ds = new DataSet();
ClaimsTable = new DataTable();
da.Fill(ds, "ClaimsTable");
DataColumn claimDates = ClaimsTable.Columns.Add("Date");
claimDates.ColumnName = "Date";
this.dgrClaimsData.DataSource = ds;
this.dgrClaimsData.DataMember = "ClaimsTable";
foreach (DataRow row in ClaimsTable.Rows)
{
MessageBox.Show("This is a row in the Claims Table.", "Testing Output");
int i = 0;
row["Date"] = i.ToString();
i++;
row["Premiums"] = i.ToString();
}
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
The columns Didnt displayed and you can not loop throgh
The Rows because the tables was empty look with me
theStorminMormon wrote:
da.Fill(ds, "ClaimsTable");
Now you filled the DataSet with Data from your table
This why all other Columns displayed in the grid
theStorminMormon wrote:
ClaimsTable = new DataTable();</ i>
Now you Create New DataTable which have not any relation with ds DataSet
So Remove it and write
DataColumn claimDates = sd.Tables["ClaimsTable"].Columns.Add("Date");
claimDates.ColumnName = "Date";
To loop for each row
foreach (DataRow dr in ds.tables["ClaimsTable"]
.Rows)
{
}
I hope this help
MCAD
|
|
|
|
|
I guess I was writing my own reply at the same time that you were writing this one. I just wanted to say thanks for your response. It's kind of you to help out, even though in this case I had figured it out too (usually I don't figure it out on my own).
Thanks!
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Is there any wya to add the "Dates" column so that it will be the first column in the data grid?
Thanks!
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
If you want to display Date Column at firs Add it First Before You Fill The DataTable a modification of previous code that will display Date column at first will be as following
DataTable table=new DataTable("Customer");
DataColumn dc=new DataColumn("Data");
table.Columns.Add(dc);
sqlDataAdapter1.Fill(table);
dataGrid1.DataSource=table;
MCAD
|
|
|
|
|
Could you please stop using that background image. It makes reading your posts all but impossible.
|
|
|
|
|
What background image you are taking about?
are you mean
This Not background image it is pre tag
MCAD
|
|
|
|
|
Yes that's exactly what I'm refering to. I don't know what you want it to do, but in both firefox and ID it's streching the length of the screen and making the text behind unreadable without highlighting with the mouse.
|
|
|
|
|
Sorry for annoying you
but nothing from what you mentioned appear in my screen
So i use it to highlight the code and its displayed whith out problem
MCAD
|
|
|
|
|
What's it look like in your browser, in FF1.06 and IE6 the area is tiled with a letter image.
Anyone else seeing the same?
|
|
|
|
|
I'll answer my own question now that I figured it out. Just in case anyone else ever wants to know...
Right, so the problem was thinking that the table I created on this line:
ClaimsTable = new DataTable();
was the same as the table created by the data adapter fill method:
da.Fill(ds, "ClaimsTable");
But the two are not the same. To access the table with my data I need something like da.tables[0]... So when I ran the foreach (DataRow row in ClaimsTables.Rows) I was accessing a table that had been created, but that had no rows.
So essentially I had two tables with identical names, but one held data and one did not and I needed to learn how to access the one that DID hold data.
Yay for learning experiences.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Good you figured it out As you guessed i wrote my previous message when you sent your message any way
I Update it may look to it
MCAD
|
|
|
|
|
To explain it in detail:
I wrote an MDI, where there is on window where there are 2 listboxes, that i use to dump incoming network traffic.
I add the strings via:
lstBox.Items.Add(string), where lstBox is my ListBox instance.
So the listbox is updatet at about 10Hz, .
So the problem is, when i open another MDI Child Form, the Form with the Listbox, focusses 10 times a second, hiding the other window if they overlap.
Is there a way to stop the listbox from drawing the focus when adding an item?
thnx in advance, Mike
|
|
|
|
|
Try
listBox1.BeginUpdate(); Before adding items
And call after you finish
listBox1.EndUpdate();
MCAD
|
|
|
|
|
that would work if i would just add a whole bunch at once.
But the output has to be real time, so it still draws the focus.
The code in question is this function, which is called at about 10Hz:
<br />
<br />
private void UpdateList(ListBox lstBox, string rsp)<br />
{<br />
int intIndex = lstBox.Items.Add(DateTime.Now.ToString("H.m.ssff")+": "+rsp);<br />
lstBox.SelectedIndex = intIndex;<br />
if(intIndex > lstMax)<br />
lstBox.Items.RemoveAt(0);<br />
<br />
}<br />
<br />
any other suggestions what to do?
i could use a text field too, but there i dont know how to keep the field from allocating more and more memory.
here i just delete all entries over lstMax's Value.
|
|
|
|