|
|
AFAIK, it's not possible - just ignoring that it would make a for difficult user experience to use it, there is no mechanism I can think of that allows you to rotate a DGV 90 degrees and still use it as a DGV. It's possible to rotate PrintDocument output by 90 degrees, but not display controls.
Why would you want to? Do your users habitually rotate their monitors to look at them?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I meant that I would have a lot of (256) columns and it is not convenient to view them in the current version of DGV. More conveniently the opposite ...
|
|
|
|
|
|
Hi guys.
I'm doing a program to update applications that we only use in my home. And what I want to do is through the network to find if there is an "X" file on the different PCs, and if there is a return of your route, otherwise it will not return anything.
Could someone help me?
regards
|
|
|
|
|
What do you mean by a return of your route ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
He means the fully qualified path to the file.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
So, what have you done/tried. Tell us about your code, show us some code, describe what works or what breaks. What is your "network" like ?
We can't read your mind !
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
First, you need to be able to identify all of the machineson your network, or provide a way for the user to specify what remote drive(s) to search.
Second, you should use UNC paths instead of shares because shares can be deleted (or Windows could simply lose them), while UNC paths always exist as long s the machine is turned on and connected to the network.
After those two things, the act of finding a file on a remote drive is beyond trivial.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
I'm still learning C# and I have a long way to go. I wanted to dive into MonoGame because tinkering with game design has been a hobby of mine since I started learning QBasic at the age of 14. I don't want to use their Content Pipeline to load content, because I'd like to figure out how to load custom resources as needed. Someone on Stack Overflow commented HERE that they use FileStreams to load textures directly. I set about trying to figure out how to do that, and I've gotten this far:
FileStream fs = new FileStream("stars.jpg", FileMode.Open);
byte[] readString = new byte[fs.Length];
fs.Read(readString, 0, (int)fs.Length);
I have no idea if that code even works, because I haven't gotten to a point where running it would yield any visible results. It seems sound, so once I get the file data in the readString array, I need a way to use it as texture data. I tried casting:
object o = (object)readString;
background = (Texture2D)o;
I already know that isn't going to work. I don't even need to run it to figure that one out. I read a little in the MonoGame Reference and thought about using Texture2D.SetData as shown HERE, but I'm not sure how to proceed or even if I'm headed in the right direction. The syntax they provide doesn't really clarify anything.
public void SetData<T>(
T[] data
) where T : ValueType, new()
There's an array here, but I'm not sure what it's asking for. Can I provide SetData with the byte array?
background.SetData(readString);
Your help would be most appreciated, and it would go a long way towards helping me advance in my learning.
Thanks.
-Turtle
modified 27-Dec-18 0:00am.
|
|
|
|
|
|
Hey Kindly do me a favor and tell me
|
|
|
|
|
Syed_Owais wrote: Hey Kindly do me a favor and tell me
Tell you what?
We have no idea what you need to know - or even what you already do know.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. So we have no idea what is "in" your file, how it is stored, what kind of file it is in - and there are a massive number of possibilities - or even if you know how to read anything from a file! Calling it "a text file" tells us very little: there are large number of ways that text can be used to store into, and an equally large number of different types of information you coudl store in it!
So sit down, think about what you are trying to do, look at your data file, and try to clarify in your own mind exactly what help you need, then try to explain that.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is weird. I replied to the OP, not you. Hmmm
|
|
|
|
|
It looks fine - but I got an email for it, so ...
Hamsters at the Eggnog, I suspect.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Reading text from a text file is basically "programming 101".
Simply Google for "C# read a text file" and start reading. This is far more than documented all over the web.
|
|
|
|
|
Another "get a brain" response that is irrelevant to the question asked.
Down-voted.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I'm sorry. Are you not enjoying your urinated Cheerio's this morning?
|
|
|
|
|
I'm going to run with the assumption that you didn't mean to sound as snarky as you did. For future reference, saying "Do me a favor and tell me" is considered bad manners. It would be a good idea to explain what it is you're trying to do and then use "please" and "thank you".
I'm going to give you basic instructions for reading from a raw text file. If you're trying to read binary data, this won't help much.
1. You need to start by placing "using System.IO" at the top of your project.
2. You need to declare an instance of StreamReader, open the file and read a line of text using the StreamReader. This is a watered down version of the class I created for my own projects:
using System;
using System.IO;
namespace FileOperations
{
public class LoadData
{
StreamReader reader;
public void open(string s)
{
reader=new StreamReader(s);
}
public string read()
{
return reader.ReadLine();
}
public void close()
{
reader.Close();
}
}
}
The official Microsoft documentation contains excellent instructions and another example. You can find that HERE. I break everything up like I do so that I'm not stuck reading every line in the file at once like in the Microsoft example. I can call the read() function and read one line at a time, or I can use a for or while loop to call it again and again. I can also leave the file open if I need to or close it immediately, depending on my coding needs.
I would recommend that if you use this code, you implement a way to check for the end of the file. That would be as simple (as the Microsoft example shows you) as checking to see if the StreamReader returns a null string.
Also, since your question shows a bit of inexperience, I feel the need to point out that you should declare a new instance of "LoadData". Here's a simple example:
LoadData ld = new LoadData();
ld.open("myfile.txt");
string readLine=ld.read();
ld.close();
You can also simply copy the functions as they are into your existing code and call them without the need of a separate class, but by doing it this way you make this code available across your entire application.
And be sure to add your own namespace at the top.
Good luck, and happy coding.
-Turtle
EDIT: It slipped my mind to mention that you don't need to do it through function calls at all if you aren't planning to add anything to them, since they serve no purpose in the watered down form in which I've given them to you. In their unedited form they do much more. If you didn't have the need to parse the text after reading it or look for specific lines or anything like that, you could simply change the last bit of code to this:
StringReader reader = new StringReader("myfile.text");
string getTextFromFile=reader.ReadLine();
reader.close();
I felt I should point that out before someone felt the need to comment on the redundancy of my example class.
modified 26-Dec-18 4:52am.
|
|
|
|
|
Thank you for this post, which actually responds to the question asked !
Up-voted.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Why create single line methods that simply call the real methods? That is just redundant coding. Reading from a filestream is much simpler, and usually doing it inside a using block is the optimum way.
|
|
|
|
|
File.WriteAllText( "data.txt", "Hallelujah, I'm a bum!" );
string someVariable = File.ReadAllText( "data.txt" ).Split( new char[] { ',', ' ' } ).First();
Console.Write( someVariable );
Console.ReadKey();
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I'm a C# programmer who loves fractals!
I've spent days trying to figure out the math behind Kleinian group fractals with no success.
There are a lot of Mandelbulb3D parameter sets available (as well as UltraFractal, Fragmentarium and other fractal applications)
But I really want to understand the math itself, and the parameter sets really don't help
Here are a couple of beautiful examples:
https://www.deviantart.com/sabine62/art/Tentacle-653134425[^]
https://www.deviantart.com/schmiegel/art/Kleine-Abschnitte-659324989[^]
I've found a lot of scientific articles on Mobius transformations, spherical reflection, and elaborate sounding stuff like "Quasi-Fuchsian", but it's bits and pieces here and there.
I can find and have figured out how to calculate the curvature of a new circle tangent to 3 other circles, but not how to calculate the center-point of the new circle.
I've about worn google out I think.... does anyone know of a good resource for how to create these fractals in language for a programmer who's not a mathematician?
I know I can do the math with the right resources to learn it, I just can't read symbolic math (i.e. Greek symbols)
Thanks in advance!
Don
[Irrelevant link deleted]
|
|
|
|
|
The problem with your question is that to understand the math, you have to understand the language of math. Anyone explaining those concepts to you is going to use the "Greek symbols" you don't know. So, go learn the "Greek symbols" and everything will make a lot more sense.
|
|
|
|