Click here to Skip to main content
15,883,798 members
Home / Discussions / C#
   

C#

 
AnswerRe: Mike`s Gradiator Pin
Richard Deeming22-Mar-21 2:41
mveRichard Deeming22-Mar-21 2:41 
GeneralRe: Mike`s Gradiator Pin
Alejandro01122-Mar-21 2:48
Alejandro01122-Mar-21 2:48 
AnswerRe: Mike`s Gradiator Pin
Gerry Schmitz22-Mar-21 7:49
mveGerry Schmitz22-Mar-21 7:49 
GeneralRe: Mike`s Gradiator Pin
Alejandro01122-Mar-21 10:16
Alejandro01122-Mar-21 10:16 
GeneralRe: Mike`s Gradiator Pin
Alejandro01123-Mar-21 14:53
Alejandro01123-Mar-21 14:53 
QuestionHow to write to Form1.texBox1 from another class. Pin
Member 1406872419-Mar-21 11:17
Member 1406872419-Mar-21 11:17 
AnswerRe: How to write to Form1.texBox1 from another class. Pin
OriginalGriff19-Mar-21 12:24
mveOriginalGriff19-Mar-21 12:24 
QuestionCombobox Text Pin
Ismael Oliveira 202119-Mar-21 8:01
Ismael Oliveira 202119-Mar-21 8:01 
Hi, Folks.

I have a problem and expect you can help me. I use C# in Visual Studio 2019. I have a combobox which I populated with a table data. I used a Datasource to do this. When the user selects a value I need a variable to receive the string value of the combobox.
My snippet is as folows:
private void Cb_Campo_SelectionChangeCommitted(object sender, EventArgs e)
{
    if (_Modo != 0)
    {
        Cb_Campo.DisplayMember = CampoTexto;
        Cb_Campo.ValueMember = CampoChave;
        ValorChave = int.Parse(Cb_Campo.SelectedValue.ToString());
        ValorTexto = Cb_Campo.SelectedItem.ToString();
    }
}

Before selection, the combobox has "Select" as a text. Tha variable ValorChave is receiving the correct value, but the variable ValorTexto, with the code above, receives "System.Data.DataRowView".
If I change that line for
ValorTexto = Cb_Campo.Text

The result is "Select", which is the initial text.
Obviously, what I need is the corresponding value to the SelectedValue.
Can anyone help me solve this?
Thanks a lot.
AnswerRe: Combobox Text Pin
OriginalGriff19-Mar-21 9:44
mveOriginalGriff19-Mar-21 9:44 
GeneralRe: Combobox Text Pin
Ismael Oliveira 202119-Mar-21 10:14
Ismael Oliveira 202119-Mar-21 10:14 
AnswerRe: Combobox Text Pin
BillWoodruff20-Mar-21 6:15
professionalBillWoodruff20-Mar-21 6:15 
QuestionUnhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu18-Mar-21 23:05
huycaothu18-Mar-21 23:05 
AnswerRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
OriginalGriff18-Mar-21 23:19
mveOriginalGriff18-Mar-21 23:19 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu19-Mar-21 2:43
huycaothu19-Mar-21 2:43 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
OriginalGriff19-Mar-21 2:56
mveOriginalGriff19-Mar-21 2:56 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 0:03
huycaothu20-Mar-21 0:03 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Dave Kreskowiak19-Mar-21 4:28
mveDave Kreskowiak19-Mar-21 4:28 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan19-Mar-21 4:38
mveRichard MacCutchan19-Mar-21 4:38 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu19-Mar-21 23:53
huycaothu19-Mar-21 23:53 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan20-Mar-21 0:10
mveRichard MacCutchan20-Mar-21 0:10 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 0:52
huycaothu20-Mar-21 0:52 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 1:00
huycaothu20-Mar-21 1:00 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan20-Mar-21 3:04
mveRichard MacCutchan20-Mar-21 3:04 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu21-Mar-21 15:51
huycaothu21-Mar-21 15:51 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan21-Mar-21 22:44
mveRichard MacCutchan21-Mar-21 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.