Categories > Coding > C# >
How do u make a themes option
Posted
My exploit is yet to have a themes option everytime i try to code it i get it wrong can anyone help?
Galaxy Z Owner│C# WPF And WIndowsForms Developer
│Fav exploits│Coco z Galaxy Z Vega X Syanpse X │Discord │ DiscordTag│Download GalaxyZ│
Replied
I've made themes, but I'm not sure if it's the most efficient way (probably not). So here's my way of doing it:
I store every form control in a separate class for organization. When I store them, I store them as arrays for each type of control (e.g. Button, Panel, etc). I then use a foreach loop (for loop for arrays) to then color the controls for a specific theme.
You can make a function to color those objects if you want, but it depends on what you plan on changing within a theme.
For example, you can do the code below for coloring buttons, backcolor, border, listbox, and textbox (I never tested how webbrowser colors work with Monaco):
(Code for the actual coloring takes around 5 minutes if you know how foreach loops work as it's really simple, example below)
This loop loops around an array and loops to the next index's value.
foreach (indexType indexName, arrayName) { //Each time the code below runs, the next index value for the array runs (e.g. [0] to [1])
MessageBox.Show(indexName + " was found"); //The indexType is usually either a variable or the array's type (String for example)
}
------------------------------------------------------------------
Color buttons = Color.FromArgb(int1, int2, int3);
Color backColor = Color.FromArgb(int1, int2, int3);
Color border = Color.FromArgb(int1, int2, int3);
Color listBox = Color.FromArgb(int1, int2, int3);
Color textBox = Color.FromArgb(int1, int2, int3)
nameOfFunction(buttons, backColor, border, listBox, textBox); //Colors all of the stuff using these colors in each foreach loop
You can then use that function with another function if you want within a single function for changing themes.
void functionName(int theme) {
Color buttons;
Color backColor;
Color border;
Color listBox;
Color textBox;
switch (theme) {
case 0:
buttons = Color.FromArgb(int1, int2, int3);
backColor = Color.FromArgb(int1, int2, int3);
border = Color.FromArgb(int1, int2, int3);
listBox = Color.FromArgb(int1, int2, int3);
textBox = Color.FromArgb(int1, int2, int3);
break;
case 1:
buttons = Color.FromArgb(int1, int2, int3);
backColor = Color.FromArgb(int1, int2, int3);
border = Color.FromArgb(int1, int2, int3);
listBox = Color.FromArgb(int1, int2, int3);
textBox = Color.FromArgb(int1, int2, int3);
break;
case default: //Not any of the valid themes
//Code here
break;
}
nameOfFunction(buttons, backColor, border, listBox, textBox);
}
I hope this helped you.
Cancel
Post
Exploits I own:Â Synapse, Electron
Scripts I've made: Aimbot GUI, Draco Admin
Scripts I'm working on: More game ESPs
Galaxy Z Owner│C# WPF And WIndowsForms Developer
│Fav exploits│Coco z Galaxy Z Vega X Syanpse X │Discord │ DiscordTag│Download GalaxyZ│
Replied
I personally create either a .ini file or .json file and have a parser for the values
from there on the program start I have a line of code go through every color value and set the appropriate color to the control
I also don't make it so every single control has its own color since that's just tedious in my opinion so all same controls get the same color
so, in the end, its something like this
1.) Parse a file with the controls and colors
2.) Loop through the controls and set color
3.) profit
Cancel
Post
Was on WRD front page
Programs I own - Synapse X, Protosmasher, Sirhurt, Sweat Heart of Sigma Chi, Scriptware V2
Languages I know - C#,JS,Lua,VB.net
Learning - Python, C
Replied
I prefer you using deserialization in json.
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post