Jump to content

C# Programming Help

AlTech

Hi all,

 

I've got 2 problems.

 

 

1. I have a program and I want it to print the contents to a HTML page or a PDF (no clue how to do this)

 

2. The program must be able to create a Tab automatically if a shortcut combination is pressed.

 

 

Thanks! :)

 

Also, anyone know of  any C# GUI/UI Libraries?

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

Microsoft winforms. Microsoft WPF.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

Microsoft winforms. Microsoft WPF.

WPF over WinForms as it's a deprecating technology these days.

Look up MVVM and maybe think about using something like MVVMLight to help.

This sounds like homework/an assignment, is that what this is?

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

WPF over WinForms as it's a deprecating technology these days.

Good to know. :)

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

WPF over WinForms as it's a deprecating technology these days.

Look up MVVM and maybe think about using something like MVVMLight to help.

This sounds like homework/an assignment, is that what this is?

Windows Forms is deprecating? How similar is WPF to Windows Forms?

 

This is not a homework assignment. And BTW nobody answered the questions.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

I just tried WPF and i think I'll stick to Windows Forms until WPF becomes user friendly.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

I just tried WPF and i think I'll stick to Windows Forms until WPF becomes user friendly.

 

I don't quite understand what you mean by user friendly. But WinForms is hardly ever used for greenfield projects anymore.

 

Windows Forms is deprecating? How similar is WPF to Windows Forms?

 

Yes it is and WPF is the successor. WPF is mature and has been in use for years now. In regards to similarity, everything is fundamentally the same however WPF offers significant improvements for software design. As I already suggested, take a look at the MVVM design pattern. It's all about separation of View (UI) from ViewModel (where the business logic/orchestration is) from Model (data/computational model). None of the layers 'know' anything about each other and interaction/communication between them is carried out via the use of various abstraction mechanisms; the ultimate intention being enforcement of good software design principles.

 

This is not a homework assignment.

 

Good to know, far too many people come here expecting to be spoon fed. 

 

This is not a homework assignment. And BTW nobody answered the questions.

 

I have a gif for responding to such statements of the obvious, it's taken all my self control not to employ its use in this case  :D

 

1. I have a program and I want it to print the contents to a HTML page or a PDF (no clue how to do this)

 

I would suggest you go look for a library for the latter, I found pages of them from a Google search. For the former you have some inbuilt stuff like this but I suspect there are going to be plenty of libraries once again. To be honest it shouldn't be harder than string parsing/escaping really.

 

2. The program must be able to create a Tab automatically if a shortcut combination is pressed.

 

A Tab... in what context?

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Hi all,

 

I've got 2 problems.

 

 

1. I have a program and I want it to print the contents to a HTML page or a PDF (no clue how to do this)

 

2. The program must be able to create a Tab automatically if a shortcut combination is pressed.

 

 

1. What is the content or do you just want to print what ever is on the window similar to screen shot?

 

2. A tab of what? Either way you want to listen for keypresses on the main window object and if the correct keypress is done make the TabControler of your choosing add a tab

Link to comment
Share on other sites

Link to post
Share on other sites

1. What is the content or do you just want to print what ever is on the window similar to screen shot?

 

2. A tab of what? Either way you want to listen for keypresses on the main window object and if the correct keypress is done make the TabControler of your choosing add a tab

1. I want to turn whatever is in the tab control page to a PDF

 

2. A tab using the tab control mechanism, I know how to implement the shortcut but I want to clone the first tab (don't ask why!)

 

So basically a user presses A shortcut combination key (e.g Control + Shift + E)  (I know how to do this bit)  and a similar or identical tab is created next to it. (don't know how to do this bit).

Sorry for not being too specific :(

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

 

 

 

I don't quite understand what you mean by user friendly. But WinForms is hardly ever used for greenfield projects anymore.

 

 

Yes it is and WPF is the successor. WPF is mature and has been in use for years now. In regards to similarity, everything is fundamentally the same however WPF offers significant improvements for software design. As I already suggested, take a look at the MVVM design pattern. It's all about separation of View (UI) from ViewModel (where the business logic/orchestration is) from Model (data/computational model). None of the layers 'know' anything about each other and interaction/communication between them is carried out via the use of various abstraction mechanisms; the ultimate intention being enforcement of good software design principles.

 

 

Good to know, far too many people come here expecting to be spoon fed. 

 

 

 

I have a gif for responding to such statements of the obvious, it's taken all my self control not to employ its use in this case  :D

 

 

 

I would suggest you go look for a library for the latter, I found pages of them from a Google search. For the former you have some inbuilt stuff like this but I suspect there are going to be plenty of libraries once again. To be honest it shouldn't be harder than string parsing/escaping really.

 

 

A Tab... in what context?

 

A tab using TAB CONTROL. AND i've never done string parsing so that might be a bit hard :( (edit: If i did then I didn't know that i did it)

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

Wait so you want to turn something in lets say a richtextbox that is within a tabcontrol page into a pdf file?

 

Or do you want to print the whole thing to the pdf? like if there's a button you want that printed as well?

 

Come chat here: https://us19.chatzy.com/87562234802287 and I'll give you some instant help for the time being.

Link to comment
Share on other sites

Link to post
Share on other sites

A tab using TAB CONTROL. AND i've never done string parsing so that might be a bit hard :( (edit: If i did then I didn't know that i did it)

 

Well look at the class documentation for the specific control then. If it's WPF you'd do this with ViewModels, Bindings and a ViewModelLocator. String parsing... well that's just processing your output data; such as adding tags to a string or removing invalid crap and escaping things like spaces and other special characters. There's no real science behind it and it's specific to your own implementation detail.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×