|
I have created a windows form to represent a real life joystick, i have represented the x and y axis with click and drag. With a track bar to represent z axis. ( Activated with mouse wheel)
Currently the trackbar is enabled when the middle button is clicked and dissabled when clicked again. I am just looking for a way to dissable the left click on the trackbar control as left click on the form should represent the x and y axis with middle click then scroll representing z.
Thanx George
|
|
|
|
|
Add an event for MouseDown or MouseUp...
You can check against the .Button property of the MouseEventArgs if it's the middle that was pressed.
Also:
You could use a MouseMove, and compare against the buttons there. So you could drag it around.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci.....
How to get the proper data....how to convert data from asci to Hex.
as i need to display the data in the Text box in the Hex format.
|
|
|
|
|
Encoding.ASCII.GetString(byte[] bytes)
or
Encoding.ASCII.GetBytes(string input)
|
|
|
|
|
I need to convert text to asci and asci to hex
|
|
|
|
|
Try string.format("{0:X2}", asciByte); which converts asciByte to a two digit Hex string.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
No It didnt work.......
Lets take an example
string data "3F 50"
after conversion i should get "? P"
but i am not getting any thing
|
|
|
|
|
Look at
Parse(str, System.Globalization.NumberStyles.HexNumber)
You will have to use it a few times and skip the spaces, but it will convert hex "3F" to byte '?'
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi all
I made a custom control. I use it programatically in another project. the problem is I get change the label content(the text that appear)
any idea?
question 2:
I have a grid. I want only part of the grid to be scrolable.so that the first row and culomn are fixed. just like the header of a browser-is fixed and the rest of the page can be scrol. is it posible in the same grid?
I prefer to use 1 grid so the culomn size are the same
question3:
can any one direct me to a window 3 layer sample project, that is working by "best practise" ?
thanks
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MyCustomControl}" >
<Border Background="{TemplateBinding Background}" >
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<TranslateTransform/>
</transformgroup>
<Border.RenderTransform>
<Label Name="lbl" >cool</label>
</border>
</controltemplate>
</setter.Value>
</setter>
|
|
|
|
|
I guess your question is not posted correctly. Please check this Chekbox "Do not interpret HTML tags (good for code snippets)" Before post the code.
And this is C# Forum. Please Post it on WPF Forum.
|
|
|
|
|
I'm creating a static ContextMenu at runtime in program.cs, which works fine except that it has a slightly different visual style to ContextMenus created at design-time (doesn't highlight properly, menu items won't check, etc.) despite having all properties manually set to the default design-time specs.
Suggestions?
|
|
|
|
|
it works fine for me. probably you are using the old context menu from vs2003 ?
or you can copy and paste your code here..
|
|
|
|
|
I should've made that more clear - I'm creating a ContextMenuStrip, which replaces ContextMenu as far as I know. I create it as follows...
menu = new ContextMenuStrip();
ToolStripItem[] items = { ... };
menu.Items.AddRange(items);
menu.RenderMode = ToolStripRenderMode.Professional;
I've also tried messing around with other properties like the margins and so forth, but it's still different from the design-time result.
|
|
|
|
|
Hi,
All controls are created at run time and the designer just writes the code for you. If you can can create the desired appearance with the designer then do that and look in the *.designer.cs file to see how it was done.
Alan.
|
|
|
|
|
I've done this as well, both for the ContextMenuStrip, and all the ToolStripItems contained in it - doesn't work.
Basically I'm still getting this. Only the text area is detected as a clickable region, and instead of showing checked items as ticked in the margin, they're just highlighted like the top item seen there.
|
|
|
|
|
i want to print a webpage using
system.Drawing.Printing namespace.i dont want to use javascript.
i want to set the settings of the page to landscape.
how can i do it
pls help
.
|
|
|
|
|
Is this a website you wrote ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Then here are the reasons your question is stupid
1 - it's not even in the ASP.NET forum
2 - if you knew anything about ASP.NET, you'd understand that the only code that runs on the client, is javascript
3 - and javascript can't set the print mode, all it can do is start the print dialog
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
well my friend i think somebody made a fool out of u .who made u a
MVP
have u heard about system.Drawing.Printing Namespace
|
|
|
|
|
Whatever code you write using this namespace will be executed on the server. How is your server going to identify the printer connected to the client and configure its properties?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
|
I have a process running on a 64bits server OS.
It does use a lot of memory and I sometimes get outOfMemory exception....
However, at best, I'm using a few tens of Megabytes at once, say 60Mb. Or even 200 Mb (if memory representation of disk data takes more space)
How come I have out of memory?
I understand there could be memory fragmentation and such, but our server have 8GB, plus, with virtual memory, process should have something like 16GB of available memory, or so I believed.
That leaves plenty of room...
Can anyone explain to me what's probably going on or how much memory is available to .NET process?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
It means that you're using too much memory in a process. What is the app doing ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'm between a rock and a hard place.
What I'm doing is:
Reading data in a DataTable
Writing the DataTable in a "MapXtreme Table".
Writing to MapXtreme is godamn slow and if I read line by line in the reader and directly write line by line in the MapXtreme table, I will certaimnly reduce memory consumption. But it might take up to half an hour to write all the data in a MapXtreme table, and I have SQL Timeout.
My SQL timeout is already 10 minute and I'm not eager to increase it more.
So I decided to read all the data in a DataTable first (quick), close the SQl connection and then write it to MapXtreme.
I have OutOfMemory of the DataTable.Load()...
Mmhh... I'm thinking I can load my data in chunk perhaps? tricky but feasible..
But then I also get out of memory in MapXtreme Table.Write (Row i.e. Feature)
I can't really do anything there... MapXtreme support is appealing so I won't get much help from their either
But anyway, the MapXtreme files are, at most, about 30~40 Mb, so it stands to reason that the memory used can't be much more than that.
40Mb is not that much in a 64bit server with 8GB memory + virtual memory, why do I get that?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|