c# WinForms.Listbox.
listBox1.DataSource = ds.Tables[0].DefaultView;
listBox1.DisplayMember = "Question";
listBox1.ValueMember = "idQuestion";
//for ValueMember showing...
textBox2.Text = listBox1.SelectedValue.ToString();
//What I must use for DisplayMember showing?
textbox3.Text = ??????????
...
Hello...I am building a WinForms Application in C# .NET
The WinForms Application has a ComboBox where the DropDownStyle is set to DropDownList. When the App is launched, I read an XML file to populate the values of the ComboBox. And, at this time, nothing is selected in the ComboBox by default. As a result, buttons Change and Delete are...
I have a WinForm application which hosts many images. When I put the application on a Win7 machines that has a DPI of 120, it completely ruins the look of the form. Is there a way to disable the scaling for my form?
I am aware that this is something that is not advised and that DPI should be seamless and handled by the OS. But when it c...
hello.
I've a program working as client and server. I'm using wcf services with BasicHttpBinding and the program is running in a console application.
When i moved the code to a windows forms application, everything stops working. When the client side invoke one operation, it doesn't returns. When some operation on server side is invo...
I totally agree that we should not use Hungarian Notation to name variables. But it seems that Hungarian Notation is still useful to name controls (especially Winform controls). Consider these:
GridView grvUsers
TextBox txtPassword
etc...
I really doubt that should we avoid Hungarian notation in this case? If should, which is alterna...
Hi,
i have a scenario where i have to group the PinCode by city name like one city can have many pincode.
I have to do this in winform in datagrid. How can i do this so in datagrid i can see the + and - on before city.
I thing it can be done by nested grid. please, help.
Column A | Column B | Column C
Country
Zip Co...
I'm developing a Windows Mobile application in C# using .NET Compact Framework 3.5. My target version of WM is 6.5.x. It was my impression that Microsoft has updated the stock controls in this release of the OS to be more finger friendly (larger fonts, greater space between rows in listboxes, etc.) but when I create, for example, a ListB...
I stored a date value and retrieve it and the format of the date in the string is yyMMdd.
Now when the user loads that from the string i would like to select the DateTimePicker as the user loaded date.
Sample code:
string strDate = strRead.Substring(23, 6);
DateTime dt = DateTime.Parse(strDate);
Can any one give me an idea for the ne...
Hi,
I display a winform as a dialog (with ShowDialog over a main window).
So, I set the FormBorderStyle to None because I wanted neither the control boxes nor the title bar.
Though, I would like a border drawn (for example a blue border like normal windows) and keep the ability to move the form.
I don't need the ability to resize it.
I t...
I'm designing a form in VS2008 and I want to snap controls to the left and right edges of the form but with more space than it gets now.
I tried changing the gridsize but that doesn't do it.
The form is for the compact framework so i'm designing for a smartphone I don't know if that makes a difference. I guess it ought to be the same...
Hi all,
I'm building a desktop to-do list app, and in my UI I have a ListView control which lists all the items in each list. Each item/row has a checkbox which updates the status of that item in the database when it is checked or unchecked. So far so good!
What I am attempting to do is re-sort the list whenever a checkbox is clicked, ...
Hello All,
I'm using windows xp and currently im developing an small win form application so I want to give vista or windows 7 appearance to my application which is running in Windows xp and I'm using c# to develop win form application.
Is it possible to do that ? If so then please let me know the way.
Thanks in Advance
Nitesh Katare
...
I am trying to display some information on a grid queried from a sql server. The data gathering can take about 10 seconds so I don't want to lock the UI thread.
I currently have code like:
ThreadPool.QueueUserWorkItem(DataUpdateThread, new UpdateParams(year));
private struct UpdateParams
{
internal string year;
internal Upd...
Hi guys
I've imported an API function like
[DllImport("gdi32.dll")]
private unsafe static extern bool SetDeviceGammaRamp(Int32 hdc, void* ramp);
while compiling its showing an error like
Unsafe code may only appear if compiling with /unsafe
how to compile with /unsafe . i'm using Microsoft Visual Studio 2008
can any one help me w...
On a WindowsCE platform (custom build) our C# gui uses regular forms to show an "popup menu".
We set the FormBorderstyle to None as we don't want the form controls to be visible.
Some clients reported "Gray boxes" after a while.
After some testing here we could reproduce the problem quite fast. When we open 2 different menu's (forms) co...
I am working on window application. I have a form where I will be displaying terms and conditions against shopping done. Below Terms and Conditions, I want to show Checkbox which user have to check as an acceptance before proceeding.
This Checkbox should come below the terms and conditions. If terms and conditions are long enough then ...
Hi,
how is it possible? I have windows Form control, derived from System.Windows.Forms.Form with WebBrowser control contained in this form. Webbrowser object instance is created in constructor of form (in InitializeComponent() method). Then in background thread I manipulate with content of WebBrowser, and I found that in some cases Form...
I'm new to MVC / MVP and learning it by creating a Winform application.
I have to some extent created the Models, Presenters and Views... Now where do my validations fit.
I think the initial datatype validation (like only numbers in Age field), should be done by view. Whereas the other validations (like whether age is within 200) shoul...
I have a car rental application I am writing. I am having some issue. Basically I want a user to pick a date from dateTimePicker2 then dateTimePicker1 I then want to subtract those numbers from eachother and store it in car. I have created a button that will multiple the per day charge then display it in a label but I just having an issu...
Hello stackoverflow.
I want my (readonly,fullrowselect) datagridviews to have no selected rows when the form is loaded. I tried .ClearSelection in the forms constructor after setting their datasource but it doesn't work (i would really like to know why...).
Then i tried in the Form_load event but it won't clear the selection on the dat...