|
if you show your code, and specify its symptoms, CP members will help and pinpoint the problem(s).
|
|
|
|
|
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
textBox1->AppendText(System::Windows::Forms::ButtonBase::Text);
}
I do this code, but it still needs System::Windows::Forms::ButtonBase::Text as a static.
I think I follow your definition - you can say that in values sender and e is everything what can we need.
|
|
|
|
|
you still need to take "sender", cast it to a Button and take its Text.
|
|
|
|
|
textBox1->AppendText(this->ActiveControl->Text);
Yipee! Fairness still exists Thank you so much
modified on Sunday, July 6, 2008 4:40 PM
|
|
|
|
|
The other answer posted to this thread will work perfectly. Another option would be to create a new usercontrol for the groupbox control collection.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hello all
I have a TabControl which has some TabPages with controls
there... (DataGridView, TextBox, Label, DateTimePicker, ...etc).
in some point of navigating in rows and filtering binding sources
the program crash and the following exception occurs:
DataBinding cannot find a row that is suitable for all bindings.
Note: I have some DateTimePickers on the form which I think the problem in.
can anyone help? please...
|
|
|
|
|
Hi,
Iam new to c#.net.Iam using windows web browser which automatically loads url from the database.It is loading allthe urls from database but i cant able to do anything in between (for eg:i need to send some data to a particular site before it navigates to another site).I am using visual studio c#.net.
My code looks like this:
SqlConnection mycon = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\hm67951\Desktop\WebBrowser\WebBrowser\webbrowser.mdf;Integrated Security=True;User Instance=True");
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("select * from urlnames", mycon);
da.Fill(ds, "urlnames");
cboURL.DataBindings.Add("Text", ds, "urlnames.url");
btnclick();
MessageBox.Show("pageloaded");
for (int i = 0; i < ds.Tables["urlnames"].Rows.Count; i++)
{
CurrencyManager cm = (CurrencyManager)this.BindingContext[ds, "urlnames"];
long rowposition = (long)cm.Position;
if (cm.Position < cm.Count - 1)
{
cm.Position++;
//this.BindingContext[ds, "urlnames"].Position++;
if (cboURL.DataBindings["Text"] != null)
{
cboURL.DataBindings.Remove(cboURL.DataBindings["Text"]);
}
cboURL.DataBindings.Add("Text", ds, "urlnames.url");
btnclick();
MessageBox.Show("pageloaded");
}
If i remove Messagebox.show option it is showing only the last url which is loaded from the database.
Thanks in advance.
|
|
|
|
|
Hello,
could anyone solve my problem. I have application working with MSSQL Server: there is one table "goods" (id, name) and another one - "info" (id, idgood1, idgood2, info), where idgood1 and idggod2 - foreign keys. That is an example of what I want.
"Goods" Table:
id | name
---------
23 | foo1
24 | foo2
25 | foo3
"Info" Table:
id | idgood1 | idgood2 | info
-----------------------------
10 | _____23 | _____24 | inf1
11 | _____23 | _____25 | inf2
12 | _____24 | _____25 | inf3
I want to see in DataGridView such structure (first row - row header, first column - column header):
____ | foo1 | foo2 | foo3
--------------------------
foo1 | ____ | inf1 | inf2
foo2 | ____ | ____ | inf3
foo3 | ____ | ____ | ____
I select data from two tables ("goods", "info") in appropriate DataTable instances: GoodsDataTable and InfoDataTable. Then I CREATE (dynamically) one more DataTable instance - VisualDataTable, which is filled according to my needs. Then I put VisualDataTable into DataSet, DataSet into BindingSource, and, finally, BindingSource into DataGridView. It's working. Until I want to update something!
I tried to call SqlAdapter's Update method as for InfoDataTable as DataSet. But nothing happens.
In general, how should I update data in case when "visual" part of DataGridView and database structure are different..?
Another words, I take data from database, and put data into database with one table, and I edit data with another table.
|
|
|
|
|
Hi,
I'm using listview control but i dont know,how to bind that list view control with database?
|
|
|
|
|
Listview doesn't support databinding.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I found this[^] while trying to sort out my problem but it only explains how to do it with an SQL table.
Dave Henry
-----------------------------------------
evil mastermind or genius benefactor?
NEVER trust the bunny...
|
|
|
|
|
Hi everyone.
I'm building a application and i have a problem.
I want to build a form with a progress bar and a cancel button that can be called by every form every time a use a background worker and want to show the percentage of progress.
Could any one help me?
Thanks in advance.
|
|
|
|
|
hi...
i hve a mdi form and i added 4 buttons in the mdi form. these buttons are shortcuts of child forms. when i open the child forms , these buttons are showing front, ie, the child form is behind these buttons... can any one help to sortout this..
Tnks in advance..
|
|
|
|
|
Their is a chance that you can call SendToBack on the buttons to allow the forms to be in front, but I sort of doubt it just because of how the MDI form is used. Why not just a toolbar in the MDI parent for the form switching.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
modified on Monday, June 30, 2008 5:19 PM
|
|
|
|
|
Hi Everyone
I have upper level framework that needs to be notified when the user has selected text in a regular textbox.
There doesn't seem to be a event to signals that the selected text value has changed.
Any suggestions other then a timer that polls the control?
Thanks
|
|
|
|
|
I think your right, there is no event for selected text, you would have to use key/mouse events or possibly on leave
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The quickest way to implement this would be with the MouseUp event. Try this approach:
private int selectedTextLength = 0;
private int selectionStart = 0;
private void textBox1_MouseUp(object sender, MouseEventArgs e)
{
if (selectionStart != textBox1.SelectionStart ||
selectedTextLength != textBox1.SelectionLength)
{
selectionStart = textBox1.SelectionStart;
selectedTextLength = textBox1.SelectionLength;
//notify framwork...
}
}
Cheers!
Richard Blythe
"Make it as simple as possible, but no simpler" Issac Newton
|
|
|
|
|
Hi,
When i assign a text to the datagrid cell that contains tabs "\t", the tab is ignored when the cell is out of focus or not in edit mode.
example:
myDataGridView[columnIndex, rowIndex].Value = "My\tText";
when the cell is out of focus or not currently edited, the displayed text is : "MyText".
when the cell is entered to edit text, the displayed text is : "My Text".
How do i force the cell to always show the text with the tabs, even in read only mode?
Thanks.
|
|
|
|
|
Sounds like a bug to me, it begs the question why you are using tab (oh yeah text colums in a grid!) instead of spaces.
Options
Manage the scroll events to reformat the cell when it enters the view range (horrible)
Use a mono spaced fon and spaces to simulate the cols!
Oh yeah and report the possible bug.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I paint some of my rows a background colour.
When the contents are written back over the background, any wordwrap settings are lost, and as much text as possible is crammed into the cell. This means that if the row height is not small enough, more than one line of text can bee seen.
It seems that StringFormat.Trimming is ignored - none of the settings have any effect.
Which means that I am forced to use very thin rows, and there is no way you can have an ellipses displayed in the cell to show that there is more.
Anybody have a better soluton?
Nigel
|
|
|
|
|
There are some fields in the datagridview that are required data and some are not. My question is, how can I prevent the user from leaving the row until they have filled the appropriate cells or canceled the pending row. If they are entering data in a required cell, I can work with that but if they are in a non-required field, I have no idea. By the way, I can't get the row to cancel with the Escape button if a cell has been typed in. Any ideas?
"Make it as simple as possible, but no simpler" Issac Newton
|
|
|
|
|
I NEVER allow data entry into a grid - always force the user to a dialog where you have greater control of the one (1) record you are working with. The one exception to this is checkboxes only.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have a complex form in a C# project.
I want to use a copy of this form in a vb.net project.
What is best practice?
Kind regards,
John Slaats
|
|
|
|
|
If you want just the controls to be copied then you can have both projects open in Visual Studio. Then copy the controls from the designer and paste them into the desired languages' designer. Keep in mind that their are conversion programs that can convert entire programs from VB<->C#.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
You should be able to just call the C# from from VB.NET. Not much to it, put the C# form in a class, compile it and reference it in the VB code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|