|
thank you that does help.
It is odd to me that the calling class sets the location and not the class itself. Seems very non OOP.
thanks again
|
|
|
|
|
I need to dynamically generate image and put some text on it.
The problem I'm having is that the text needs to be as if it was on a sphere.
Imagine 400x400 pixel ball and write some text on it. It will look different at top and bottom and right and left sides will be vanishing.
Can it be done thru matrix transoform? if so how would i set one up?
Thanks.
|
|
|
|
|
I wrote a simple dBase Program Editor for Program Files.
Now I wanted to add the following functionnality:
IF X=0
DO XPRG
ENDI
--->
IF X=0
DO XPRG
ENDI
For this method I need the count of tabs in a line (because of reloading, when tabs already are set).
The Problem is that Line.IndexOf("\t") does not return the right value (RichTextBox always find this value and never returns -1).
So how is it possible to determine how much tabs are in a StringLine? Or is there another way to solve this problem?
Thanks.
Stefan
|
|
|
|
|
C#:
private <font color="blue">void</font><font color="blue"></font> Form1_Load(object sender,<font color="blue"></font> System.EventArgs e) <br> { <br> richTextBox1.AppendText("some\ttext\twith\ttabs\tin\tthere"); <font color="#006400">
hope that helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Thanks a lot for this idea!
Stefan
|
|
|
|
|
All,
Does anyone know how to change the icon/bitmap in a listview on a windows form? The first subitem in my listview is an icon and I want to change it based on the value of another subitem.
For example: I've got a negative value in the second subitem, I want the first subitem icon/bitmap to be a down arrow. Conversely if the second subitem is positive I want to the first subitem icon/bitmap to be an up arrow.
I think changing this at runtime might be easier?
Thanks
|
|
|
|
|
Hi there,
Could someone confirm that Bounds Checker works and will give me information on memory leaks and CPU resource problems?
Thanks
|
|
|
|
|
|
leppie wrote:
I very much doubt that.
I have a question in this regard.
What's the future for companies like NuMega (Bounds Checker) in the .NET world?
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
What's the future for companies like NuMega (Bounds Checker) in the .NET world?
Maybe like this[^]
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
Kant wrote:
What's the future for companies like NuMega (Bounds Checker) in the .NET world?
Maybe products that ensure that scarce resources are disposed of properly. Stuff like GDI+ objects, DB connections, Files, etc. All could possibly impact system performance if not handled correctly.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
i have a treeview control with about 20 subnodes. each time i click on a new node, a related form opens in the parent window. how can i close the currently opened form once a new node is selected in the treeview control?
thanks for your help.
|
|
|
|
|
First you will need to grab a reference to the parent window and the active window. Then you can close the active window. What I did was set a reference to the parent window in a var. Then I was able to call the variable and get the ActiveMdiChild property and set that property to close. So I have something like this
if (parent.ActiveMdiChild != null)
{
parent.ActiveMdiChild.Close();
}
|
|
|
|
|
thank you for your help. it worked exactly like you said.
|
|
|
|
|
Below is the code I am trying to use. I am trying to update a row in the datatable. The test2 just points at which row it should update. The error I get tells me I am trying to create a duplicate key. I understand that, but I cant figure out anyother way to update the database. On other tests, the dataTable updates perfectly, however the DataAdapter does not update the database. Please help me if you can.
DataRow newRow = categoryDataTable.NewRow();
newRow["catCategoryID"] = test2;
newRow["catCategoryName"] = catTextBox1.Text;
categoryDataTable.Rows.Add(newRow);
categoryDataTable.AcceptChanges();
categoryDataAdapter.Update(categoryDataTable);
|
|
|
|
|
Your code is actually, Adding a row to the table not updating one. Since you are "adding" a row with the same ID as one that already exists and thus the error.
If the row you want to modify is in the table already, all you have to do is:
categoryDataTable.Rows[test2]["catCategoryName"]=catTextBox1.Text;
categoryDataAdapter.Update(categoryDataTable);
Depending on how the DataAdapter is configured it will autmatically accept the changes when it updates.
The other problem is that you called AcceptChanges prior to an update on the DataAdapter. That would tell your dataset/table that the changes have been accepted and to clear the flag saying their are added or modified. That is the flag that the DataAdpater uses to update your data on the server by.
Rocky Moore <><
|
|
|
|
|
Hi, I still cant get it to work. I put the code in that you had, and it did not update. So I wanted to check if it was doing anything, and if I told it to update to a row that was not there, it informed me that the row is not there. The same update command seems to work in other sections when adding new data. Is there anything else you can suggest to help me?
|
|
|
|
|
Hi, sorry, further tests have shown something interesting. Perhaps you can help with this. I have a listbox which is bound to a textbox and I have an update button. If i select something from the listbox, it is displayed in the textbox. When I change it and click update, no changes are made. However, if i select it, change it, then select something else from the listbox (this can even be the same thing again) and then click update - it works. By that i mean it updates the database as it should.
|
|
|
|
|
Are you using any DataBinding on your text box?
For an example. I built a WinForm app and used the Pubs database that comes with SQL Server. I built a SQLDataAdapter to "Select * From Stores" and then built a dataset off that data adapter (in my code I called it "dset".
In the Form contructor after initializeComponents(), I called:
sqlDataAdapter1.Fill(dset)
Next, I added a DataGrid to the form and set it's DataSource to "dset.stores".
Next, I put a button on the form called "Updated".
Next, I put a listbox on the form and added three city names to the listbox collection.
Next, I added a text box (given the ID CityBox)
Next, I double clicked on the ListBox causing a SelectedIndexChanged event handler to generate. In that handler I put:
CityBox.Text = (string) ((ListBox) sender).SelectedItem;
Next, I double clicked on the Update Button and it generated the Click event handler which I put this in:
dset.stores[5].city = CityBox.Text;
sqlDataAdapter1.Update(dset);
That was due to knowing the row I wanted to update. I could have put:
dset.stores.FindBystor_id("8042").city = CityBox.Text;
sqlDataAdapter1.Update(dset);
Of course you would use proper error checking and what not but this is just a quick example.
I can select the item, it updates in the text box and then I click update and it writes out the changes. At least it works here.
If you have any of your controls such as the text control databound and you are working with a CurrencyManager, you might check into EndCurrentEdit.
Or if you are using BeginEdit,EndEdit to delay validation on a Row:
DataSet1.storesRow sr = dset.stores.FindBystor_id("8042");
sr.BeginEdit();
sr.city = CityBox.Text;
sr.EndEdit();
sqlDataAdapter1.Update(dset);
Rocky Moore <><
|
|
|
|
|
The database will not be updated because you call AcceptChanges() before DataAdapter.Update(). After you called AcceptChanges() the RowState for all Rows is "UnChanged". Then you call the DataAdapter.Update() but the Update Method cannot find any Rows which are marked as "Modified", so the DataAdapter doesn't update any rows.
Just call DataAdapter.Update() without AcceptChanges() before and the table will be updated in the database too.
I had the same problem as I started with C# and databases. The microsoft help is also confusing because everywhere is written to use AcceptChanges() to update a datatable.
Hope this helps.
Stefan
|
|
|
|
|
Can anyone help me to realyse ssh2 on c#?
Any links?
Thanks
=====================
http://wasp.elcat.kg
|
|
|
|
|
|
i created a table with 9 columns using datatable and tablestyles.
Also i got a DataRelation.
How can i tell my childcolumn to change if the parentcolumn changes?
e.g. in column "number" is 10 the value,
if value changes to 17 in parenttable,change it also in childttable
Thanx
|
|
|
|
|
Help!
In C# how can I create a few views and according to the view selected from a menu change the view being displayed on the main frame??
Also is it posible to create the different views using the designer?? or doing this will create different frames instead?
Sorry this is for a windows application
|
|
|
|
|