|
Hi,
I just starting to play around with managed Direct X. What I want to do is create an application which has a windows form with a PictureBox containing Direct3D graphics but I'm having trouble getting started. I tried setting passing the PictureBox control to the constructor for Device and then simply blanking it to a uniform blue (borrowing code from tutorial 1 in the SDK documentation). I was calling the Render() method to do the rendering on the OnPaint event but nothing seems to be happening - the picture box remains defiantly grey!. What am I missing here?
What I'd ideally like to do is create a custom Direct3DPictureBox control inheriting from PictureBox so I can drop it into my apps without worrying about them too much.
Thanks
"Where do we go to get our good name back?...we go where we always go when a dramatic change is needed. We go to the ballot box" - Al Gore 5/26/04
|
|
|
|
|
Please i need helping in TAPI application ?
i am student ,and i want to work on some telephony application
i know that the perfect subject is TAPI ,but there are some questions :-
1- can i use the TAPI in c# language ?
2- should i install some files or dll files that help to execute TAPI functionallity ?
3-couild i have an example in c# that shows me how exactly work with TAPI in c#?
finally ,forgive me for my bad english?
|
|
|
|
|
What was wrong with the responses that Michael and I gave you the other day? No one is going to do this work for you.
- Nick Parker My Blog | My Articles
|
|
|
|
|
I need to put toolbar item to my windows application to make the selected text subscript or when it pressed , typed letters or numbers will be subscript.
I searched more about this topic on the net but I can only find some this:
myRichTextBox.ToolbarLayout = "bold,superscript,subscript";
but doesnt work there is no option in the Richtextbox class like "ToolbarLayout"...
any help..I would be glad...thanks
|
|
|
|
|
Unfortunately, MS didn't expose all the functions of the RichText control for .NET.
You can do something like richTextBox1.SelectionBold = true but there's no such thing as richTextBox1.SelectionSubScript = true
But since the .NET RichTextBox in fact just wraps the Win32 RichEdit control you can use the structs and messages for this control to achieve subscript, superscript, various underline styles and so on.
Take a look at this article here, I've added something similar to the RichTextBoxEx class already (look towards the end of the article).
This can be easily modified to add subscript/superscript formatting for a selected range od text.
Regards,
mav
|
|
|
|
|
first of all , thanks mav , this is the second time you saved my life
I've read the article...I know I ll take a look at this article in the future a lot...it will help me the modify RTB's class properties...
I found something like that after I've read the article you prefered.
richTextBox1.SelectedText = "10";
// Set the CharOffset to display superscript text.
richTextBox1.SelectionCharOffset = 10;
// Set the superscripted text.
richTextBox1.SelectedText = "2";
// Reset the CharOffset to display text at the baseline.
richTextBox1.SelectionCharOffset = 0;
This is the article
And another article I've found , it's here
I'll check them and try , if they doesnt work...I 'll try modifying the class.
Thanks for your help again...
Regards,
Brown Jacket
|
|
|
|
|
I've downloaded an ActiveX component and attempted to create an object of a type contained in the component. However, in using the following line of code
/cm11a.controlcmClass x10 = new cm11a.controlcmClass();
I receive the error:
'cm11a.controlcmClass.controlcmClass()' is inaccessible due to its protection level
The class is declared as public and no alternative constructors are available.
I've also tried:
<br />
Type type=Type.GetType("cm11a.controlcmClass",false,true);<br />
object x10= Activator.CreateInstance(type);<br />
((cm11a.controlcmClass)(x10)).Init();<br />
but get an exception on the 2nd line as type is null (ie the "GetType" call failed).
Any ideas or suggestions on getting either method to work would be greatly appreciated.
Thanks
Ashley
PS If anyone knows of a library which can be used to control a CM12 interface I'd love to hear of it
|
|
|
|
|
please tell me how to do dictionary in C# (in Console Application and Windows Application.
thank you.
|
|
|
|
|
ala`a ali wrote:
please tell me how to do dictionary
What does this mean?
Do you mean to ask how to use one of the following classes: System.Collections.DictionaryBase , System.Collections.Specialized.ListDictionary , System.Collections.SpecializedHybridDictionary or System.Collections.Specialized.StringDictionary .
Or do you mean to ask how to implement a natural language dictionary, like the Oxford English Dictionary?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
i wanna to use the following code to get
hte system imagelist ,but it doesn't works well,the iconCount always equal 5,and so
i can't get the correct imagelist;
[DllImport("comctl32.dll")]
private static extern int ImageList_GetImageCount( IntPtr himl );
public static ImageList GetSystemImagelist(bool isSmall , bool isSelected )
{
SHFILEINFO info = new SHFILEINFO(true);
int cbInfo = Marshal.SizeOf(info);
SHGFI flags = SHGFI.SHGFI_SYSICONINDEX;
SHIL size ;
if(isSmall == true)
flags |= SHGFI.SHGFI_SMALLICON;
else
flags |= SHGFI.SHGFI_ICON;
if(isSelected == true)
flags |= SHGFI.SHGFI_OPENICON;
ImageList imageList = new ImageList();
IntPtr imageHandle = SHGetFileInfo("C:\\",0,out info, (uint)cbInfo,flags);
IntPtr iconHandle = IntPtr.Zero;
int iconCount = ImageList_GetImageCount(imageHandle);
for (int i = 0; i < iconCount; i++)
{
iconHandle = ImageList_GetIcon(imageHandle, i, 0);
imageList.Images.Add (Icon.FromHandle(iconHandle));
}
return imageList;
}
|
|
|
|
|
in visual c++ ,we can do it by the following
code:
void GetSystemImageList(CImageList * pSmallList, CImageList * pLargeList)
{
SHFILEINFO ssfi, lsfi;
HIMAGELIST hSystemSmallImageList = (HIMAGELIST)
::SHGetFileInfo((LPCTSTR)_T("C:\\"), 0, &ssfi,sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
pSmallList->Attach(hSystemSmallImageList);
HIMAGELIST hSystemLargeImageList = (HIMAGELIST)::SHGetFileInfo((LPCTSTR)_T("C:\\"), 0,&lsfi,sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_ICON);
pLargeList->Attach(hSystemLargeImageList);
}
but i dont'know how to get it in c#.
|
|
|
|
|
|
Hi everyone
i am trying to code a program that should be able to play videos besides other features.
I thought it would be easiest to accomplish the task by just integrating the Windows Media Player-COM-Object, but i couldn't get the controls to disappear (i want my own user-interface..). I read about mediaplayer-integration in a book called 'Advanced C# Programming' by Paul Kimmel. But he seemed to use a different com-object and the demo-app to that chapter doesn't compile (can't find the reference to AxMediaPlayer). The only COM-object i found, that looks like it has really something to do with the mediaplayer is this: AxWMPLib.AxWindowsMediaPlayer. But with this one i get these nasty mediaplayer-controls that i can't get rid of.
Can anybody help me with this, or does somebody know a better solution?
thanks in advance
|
|
|
|
|
i just downloaded the media player 9 SDK and tried to compile the c#-sample (named tune-clipper). As written i registered the wmppia.dll with regasm.exe and installed it with gacutil.exe (Global Assembly Cache Utility). This seemed to be successful. But as i tried to compile the tuneclipper i stumbled accross compile-errors (actually 18 of the same kind):
D:\dev\SDKs\WMSDK\WMPSDK9\samples\dotNet\csharp\Form1.cs(689): 'AxMicrosoft.MediaPlayer.Interop.AxWindowsMediaPlayer' does not contain a definition for 'controls'
I get this one when a call to Player.controls.xxx is made. Player is defined as 'private AxMicrosoft.MediaPlayer.Interop.AxWindowsMediaPlayer'. Player.controls seems to be undefined.. very strange.. (i guess Microsoft-code is supposed to run..)
Does anybody know a way out?
|
|
|
|
|
I'm not sure but I think the you may use the property 'uiMode'. Valid values are "none", "mini", and "full"... eg...
wmp1.uiMode = "none";
Also.. If you don't want the context menu for the Windows Media Control , use
wmp1.enableContextMenu = false; // true to turn it back on
Hope that helps..
Yippee Kai Yai
Signed Polomint.......
|
|
|
|
|
Yup, thanks.
does your mediaplayer have the 'controls'-property?
As i wrote, mine somehow doesn't. Without it i can't really control media-files. All the play-, stop- and pause-methods are in there.
|
|
|
|
|
I've just checked for the controls property and I do have it.
wmp.Controls( int index );
I assume that the index is the index of the play/pause controls etc.
Are you using Visual Studio? I use VS2003, and all I do is add the Windows Media Player COM component to the toolbox, then use it.
HTH
John
|
|
|
|
|
Damn, my post was hijacked by Anonymous !!!!
I've just checked for the controls property and I do have it.
wmp.Controls( int index );
I assume that the index is the index of the play/pause controls etc.
Are you using Visual Studio? I use VS2003, and all I do is add the Windows Media Player COM component to the toolbox, then use it.
HTH
John
Yippee Kai Yai
Signed Polomint.......
|
|
|
|
|
damn hijackers
I use VS2003, too. At first i just integrated the mediaplayer in my toolbox like you. But as i found out i didn't have that controls-interface in my mediaplayer (but the microsoft-one has) i downloaded the SDK. I still can't compile their sample-app.
Btw: I have a Controls-interface.. but not the one that microsoft in the sample uses . But i can't type wmp.Controls(myindex); because in my VS2003 it's not a method.. In the microsoft-sample it's also written lowercase ('controls') and it has functions like play, stop and pause.
This friggin thing is starting to go on my nerves.. why can't it just work as it's supposed to be.. or at least as the help tells me it works..
|
|
|
|
|
Does anyone have a class for manipulating the windows volume controls from within a c# program? Thanks to other articles posted in the site I've been able to integrate CD playing in my applicatoin and now I want to control the volume as well.
Thanks in advance.
|
|
|
|
|
You could use a TrackBar derived control for this.
Try this code, it works yet leaves room for you to play with:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class VolumeControl : TrackBar
{
[DllImport("winmm.dll")]
private static extern int waveOutSetVolume(IntPtr device, UInt32 vol);
public VolumeControl()
{
base.Minimum = 0;
base.Maximum = 0xffff;
base.TickFrequency = 4096;
base.SmallChange = 4096;
base.LargeChange = 8192;
this.ValueChanged += new EventHandler(VolumeControl_ValueChanged);
}
private void VolumeControl_ValueChanged(object sender, EventArgs e)
{
waveOutSetVolume(IntPtr.Zero, (uint)(Value|Value<<16));
}
}
Regards,
mav
|
|
|
|
|
Works for setting the wave/mp3 volume but not for accessing the CD volume.
Other ideas?
|
|
|
|
|
You're right, if you want to specifically target the CD volume only, then you'll have to use the Win32 mixer* functions.
But beware, the whole process will become a bit complex and correct declaration of the functions for P/Invoke is crucial.
This link should get you started, though:
Audio Mixer Reference
Regards,
mav
|
|
|
|
|
I designed a dataDrid (with C#) with ColumnStyles --> DataGridBoolColumn
and i want this column to respond to only one click
can any one help me ?
|
|
|
|
|
Hi,
Please Check @ http://www.syncfusion.com/faq/winforms/
Happy Coding
|
|
|
|