|
Perhaps my problem is that the graphic control itself, is not created by the .NET machinery, but inside of the Win32.dll (using the low level CreateWindowEx API).
Then the problem is how to use SetStyle(ControlStyles.Selectable, true)
with a control that is not created in a .NET class ?
|
|
|
|
|
I'm trying to create a custom DataGridColumStyle object that has a color dialog attached. When the user clicks the cell the color dialog is displayed and a new color can be selected and then displayed in the cell.
The problem is... I just don't have a clue where to start.
I've previously created a custom column that uses an enum to populate a combo box so I thought it wouldn't be a problem but I was wrong
Can anyone help?
|
|
|
|
|
Place code like
MyColorDialog dialog = new MyColorDialog();
dialog.ShowDialog() in DataGridColumnStyle.Edit method
|
|
|
|
|
i want to record sound , help me please !!!!!
|
|
|
|
|
|
I found this example in MSDN and download it , but it doesnt work ,it was because of wavein /waveout class .i couldnt get that how to work .
but you show me a complete solution of that .
Thanks
But
please dont judge when you dont know anything about me ,
"i searched Record Sound C#" and nothing suitable result!!!
|
|
|
|
|
Hi all,
Iam working on a windows application where we have to do backgorund operation(Communication check with hardware) and have to update the GUI Status icon(if Commn. passed- Green color, failed-Red color). Initially i used the windows timer to do the background commn check but this was sometime hanging the GUI. so i changed this into a system timer operation but this introduces the thread safe problems since i have to update the GUI thread's status icon on the system timer's thread. is there any way to do this. is there any spl class available on .net for doing background operation. without affecting GUI.
Thanks
Srini
|
|
|
|
|
Keep using the System.Timers.Timer and use Invoke or BeginInvoke to update your GUI. This article[^] probably helps you in doing so.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
i have tried to use invoke in timer thread. but some times i get a exception Object disposed or windows handle has not been created. but this background worker components sove the issue.
Thanks
|
|
|
|
|
how bout you try running your process on another thread? try using the BackgroundWorker.
|
|
|
|
|
|
Hi,
Is there a Multiview control like in ASP.NET 2.0 (or like TNotebook component in Delphi), that can be used in a C# Windows Forms application? I didn't found such a component among the standard components shipped with VS 2005.
I need to change the displayed controls within a dialog, upon an event, but without tabs for each view (like in tab control).
Can anyone post some info on how can that be achieved in C# Windows Forms App?
Best Regards,
Yas
|
|
|
|
|
The easiest way is to create custom controls that each represent a possible view, expose delegates for events you want in your main form, and then show/hide those controls to get your views in the one form
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Christian,
Thank you for your answer!
I have one more question: Is it possible to use the tab control but with hidden tab buttons and if yes, how can I hide the tab buttons?
Best Regards,
Yas
|
|
|
|
|
I doubt it. You could perhaps create an owner drawn tab control that draws no tabs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
try
{
cn=new SqlConnection("server=.;database=Stock_Accounting; integrated security=true");
cm_combo=new SqlCommand();
cm_combo.CommandText="select * from Cust_Info";
cm_combo.Connection=cn;
cn.Open();
SqlDataReader dr_combo=cm_combo.ExecuteReader();
comempnam.DataSource=dr_combo;
comempnam.DisplayMember="Cust_Name";
comempnam.ValueMember="Cust_ID";
dr_combo.Close();
cn.Close();
}
catch(Exception ee)
{
MessageBox.Show(ee.ToString());
}
it gives me an error " comblix databinding accepts as a datasource either an Ilist or an Ilistsource"
pleaze help me
MD_NADA
|
|
|
|
|
You need to data the data from the SqlDataReader and put it into a collection that implements either the IList or IListSource interface such as Dataset or Datatable.
|
|
|
|
|
use these instead of data reader
SqlDataAdapter da = new SqlDataAdapter(cm_combo);
DataTable dt = new DataTable("Table");
da.Fill(dt);
comboBox1.DataSource = dt;
comboBox1.DisplayMember = "au_lname";
comboBox1.ValueMember = "au_id";
|
|
|
|
|
better still, just after you execute your data reader, insert a do while loop to iterate all rows read (i.e:
if(dr_combo.HasRows())
{
do
{
comempnam.Add(dr_combo["Cust_Name"]);
// or if you choose to display the Cust_ID then:
//comempnam.Add(dr_combo["Cust_ID"]);
}
while (dr_combo.Read());
}
cn.close();
hopefully, this should work.
'Tilewa
-- modified at 12:38 Sunday 24th September, 2006
|
|
|
|
|
hi all,
i want to ask my question with this illustration:
i have a pen object. then color property (typeOf(String)) of this pen can be "white", "red"... and it possibly can change. and i don't want to save it into the database but it needs to be managed at runtime.i.e a combo box will pick its items from it and an admin can (using a UI)change thye available colors. can i save this enum in the config file? how do i save at design time and how do i modify at runtime?
Thanks for any suggestion
|
|
|
|
|
You can serialise any item, so long as it's marked as serialisable, and can be rendered to and from a string. An enum will be fine in this regard.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks. But i think you are getting my question wrongly.
A pecil object has a Color property, TypeOfEraser property, Thickness(H,HB,B..) property..
Each of these properties are enumerable: Color.White, Color.Green...; TypeOfEraser.Big,TypeOfEraser.Red...; Thickness.H,Thickness.HB...; and these enumerations can be altered by an administrator of the app. rather than pull/push these values into an SQL db, i ask if it is better to save them in a config file. Now this means i'll have to be able to read the config file at runtime and persist changes too.
please how do i go aboout this?
thanks
'Tilewa.
|
|
|
|
|
As Christian said, you can serialize your object (Pencil in your case) to a file and read it back without writing any custom code.
Just mark your class with the [Serializable] attribute and you're ready to go. You need to make sure that types of member variables (and their members, essentially the whole object graph) is marked as [Serializable]. <code>Enum</code>s are serializable , so you won't have any problems there.
|
|
|
|
|
Hi!
How can i work with the Windows Media player control on my form i mean not in Asynchronously mode, how can i load it playlist or one sonf, and how can i play it?
Thanks
|
|
|
|
|
add mediaplayer into your toolbox.after that use of its property and events .
set axWindowsMediaPlayer1.URL= "Address of your mp3 or audio file" to run the mediaplayer.<br />
<br />
for stop :<br />
axWindowsMediaPlayer1.Ctlcontrols.stop()<br />
<br />
and other properties and events
|
|
|
|